Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="pnlSent" style="display: none">
- <%= Html.DropDownList("select","msgtype") %>
- <% foreach (Usp_GetUserMessagesResult w in (List<Usp_GetUserMessagesResult>)ViewData["UListM"])
- { %>
- <li>
- <div class="question-info">
- <input id="Checkbox1" type="checkbox" onclick="function() { alert("df") ; } " />
- <div class="views count"><span></span></div>
- <div class="question">
- <div class="meta">Subject: <%= w.Subject %></div>
- <div class="meta">To: <%= w.Username %></div>
- <h3 class="title"><%= Html.Encode(w.Mesg)%></h3>
- </div>
- </div>
- </li>
- <% } %>
- </div>
- <% using(Html.BeginForm("Retrieve", "Home")) %>//Retrieve is the name of the action while Home is the name of the controller
- <% { %>
- <%foreach (var app in newApps) { %>
- <tr>
- <td><%=Html.CheckBox(""+app.ApplicationId )%></td>
- </tr>
- <%} %>
- <input type"submit"/>
- <% } %>
- public ActionResult Retrieve()
- {
- //since all variables are dynamically bound you must load your DB into strings in a for loop as so:
- List<app>=newApps;
- for(int i=0; i<app.Count;i++)
- {
- var checkbox=Request.Form[""+app[i].ApplicationId];
- // the reason you check for false because the Html checkbox helper does some kind of freaky thing for value true: it makes the string read "true, false"
- if(checkbox!="false")
- {
- //etc...almost same for other parameters you want that are in thr form
- }
- }
- //of course return your view
- return View("Index");//this vaires by the name of your view ex: if Index.aspx
- }
- <script type="text/javascript">
- function handleCheckbox( theBox ) {
- if( theBox.checked) {
- // do checked stuff
- }
- else {
- // do un-checked stuff
- }
- }
- </script>
- ...
- <input type="checkbox" value="<%= w.MessageID %>" onclick="handleCheckbox(this)" />
- For Each ctrl As Control In Page.Controls
- If TypeOf ctrl Is TextBox Then
- CType(ctrl, TextBox).BackColor = clr
- Else
- If ctrl.Controls.Count > 0 Then
- SetTextBoxBackColor(ctrl, clr)
- End If
- End If
- Next
Add Comment
Please, Sign In to add comment