I have an a-z menu in an asp.net repeater. I'd like to highlight the currently selected link. I tried the following code in the itemdatabound but it does not work.
[Code]....
The reason is because the urls are not rendered at this point so they look like: ~/folder- ame/page.aspx?az=B.
For every search result I create a dropdown list with 2 month booking overview.
<ddl> <item value = "1"> January - February </item> <item value = "2"> February - March </item>
etc.
Then I call function to generate 2 months calendar view, which has two parameters generate(startmonth as Integer, sku as string)
Everything works when I hardcode starmonth as some integer.
I spent all day with no progress on how to pass value. I need a guide. I guess second problem will be to restore changed dropdown values on Postback, but one step at a time.
But what I want to do, to pass selected item value, to function, that would change view for property associated with this dropdown.
I'm trying to retrieve the value of the "ListName" field that was clicked in the repeater but I'm getting null ("") in "ListTitle", please could someone correct my code:
Protected Sub repTriggers_ItemCommand(ByVal sender As Object, ByVal e As RepeaterCommandEventArgs) Dim ListTitle As String If e.CommandName = "trigger" Then ListTitle = CType(e.Item.FindControl("lnkTrigger"), LinkButton).Text
im having a quizz (a question and multiple answer related to the question) , i use an asp repeater to display the questionand a nested radiobuttonlist inside the item template for the related answer:
[Code]....
I do bind the the radiobutton on itemDatabound, i need to store the answer selected by the user, for that i used the following method:
[Code]....
but the rptAns referring to the radiobuttonlist (there is only one quiz at a time), the selectedindex always remain at the first index even when the user does change the selected radio button.i have made a check when on item databound to see if the page is a postback before opulating the radiobuttonlist.
I have a panel which has a repeater within it. Within the repeater I have a few controls. One of those controls is a Drop Down list which has an OnSelectedIndexChanged event. I can get this to fire without issue but I cannot find my DropDownList control within that repeater within the SelectedIndexChanged event . The repeater has an OnItemDataBound event and I can use the RepeaterItemEventArgs to find the control using e.Item.FindControl("ControlName") without issue but when that event occurs is NOT when I need to find the DropDownList.
What I want to do is have another control's Visible property be set to "true" when the value of the DropDownList meets a certain value. As far as I know I can only do this during the SelectedIndexChanged event and I can't change the signature of the event by trying to use RepeaterItemEventArgs.
I have one repeater on page which has his own sql data source. I've placed 2 dropdown lists on the page. The repeater has jQuery DataTable plugin. With 2 dropdownlist I wish to change the sql stored procedures so when each will be selected the data in repeater will change. When user select the first there will be only data (users) according to selected item and in the second the same. I wrote 2 simple functions for changing stored procedure of repeater and rebiding it. Everything works but when I try the second one and then the first I always get warning about error "Procedure or function .... has too many arguments specified".
I think that when I select the first one the second function is still called although I don't call it.
i need to Filter and display Google Map Markers from database based on DropDownList selection. for that I need to pass the selected value of DropDownList to the query.What should i do in the following code to do the above task?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI;
I have one repeater and one gridview, i want to bind my repeater when link button is clicked which is inside repeater, i user itemCommand but its not working....
I have a user control that displays a shopping cart in an ecommerce application.
The main cart display is a repeater that renders as a html table. In one of those table columns, there is another repeater to display people associated with the products int he cart (it's a repeater in case there is a line item >1 with multiple people).
I've added an ImageButton that I want to use to change the person associated with the item. At first, when I'd click on it I was getting this error:
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
So as an experiment I disabled EventValidation on the page (not the control it's self) and now I do not get an error, but I also do not ever hit the breakpoint I set in the innermost repeater's ItemCommand event.
So I wonder how I might do this without disabling EventValidation, because this control will show up on multiple pages and we don't want to edit them all. Also, I'll need to know not only the repeater containing the control's row that the event came from but also the row index of the repeater containg this one. Is this possible?
I'm so confused I wasn't even sure what to make the title so that it would make sense.
Here is what I have:
[code]...
I have links at the top of the page that are the letters A-Z. What I want to do is click on one of the letters, then show only the div IDs that start with that letter. I can't figure out how to do this since I'm dynamically creating the ID names. I had it set up nicely with Javascript and CSS, but the function call was inside the repeater. The layout is changed now, and I don't understand how to make the div ID available outside the repeater.
what changed do I need to make to my code for it to achieve what I'm after.
At the moment I am getting a "cannot cast to type" error message with the below code.
I have also tried calling the ItemDataBound method in with the parent repeater tags and had no errors but when I clicked on the button it would just move back to the top of the page and would not hide or show any data. Also I have made the div style to none but the first record still shows its child but the rest don't.
I have two gridviews on same page - If a record is selected in Gridview1, I need to unselect a record (if one is selected) in Gridview2 - and vice-versa.
How to get the selected item from the listbox in the selected index changed event. I tried: Label1.Text = ListBox1.SelectedItem.Text; It is giving me object set to null reference.
foreach (ListItem item in ListBox1.Items) { if (item.Selected) { //lblResults.Text += item.Text + " "; Label1.Text = item.Text; } }
Now suppose if 3 questions are displayed on the webpage then 3 radiobuttonlists are displayed. I need to send the selected text of radiobuttons separately in my table in SQL Server on a button click event.
Suppose if selected answers are Very Poor, Average and Good then database entry should look like:
1 Very Poor 2 Average 3 Good
(.aspx.cs file)
protected void AddComment(object sender, EventArgs e) { string constr = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; string sqlStatment = "INSERT INTO FeedbackResponse(QUESTION_ID,RESPONSE) values(@QID,@RESP)"; using (SqlConnection con = new SqlConnection(constr)) { using (SqlCommand cmd = new SqlCommand(sqlStatment, con)) { con.Open(); cmd.Parameters.AddWithValue("@RESPONSE",this.rptComments. cmd.ExecuteNonQuery(); con.Close(); } }
I am creating a survey page that has a list of questions and answers that can be radiobuttonlists, checkboxlists or textboxes. These controls are added dynamically to a Repeater in its ItemDataBound event using Controls.Add.
I've managed to render the page ok but when I submit the form and iterate over the controls in the repeater to get the selectedvalues of the radiobuttons and textbox values, FindControl returns null. What do I need to do to get get the selected values? I've tried iterating over the RepeaterItems but that returned null too. I've tried different types of FindControl but it never resolves the control types.
It works if I add a declarative DataBinder in the Repeater like this
However, I want want to dynamically add the controls but in doing this i cant get the selectedvalues when submitting. This is tha main structure of my code...