|
You have to use JavaScript validation in order to check whether the required data is filled or not and make the next tab active.
Either you love IT or leave IT...
|
|
|
|
|
Hi, after some hours dealing with the above error message, i am afradid need help on this:
i have a DetailsView control, inside it i have some templatefields, one of them is a radiobutton list.
When, in Edit mode, the user changes the radiobutton seleccion (onselectedindexchanged = "RefreshDropDownList"), i need to recharge another templatefield wich is a DropDownList, with new values on it. The DropDownList is bounded to some ObjectDataSource and my purpose is "swap" to anthoer ObjectDataSource when the user changes the RadioButtonList selection.
The method RefreshDropDownList is:
protected void RefreshDropDownList(object sender, EventArgs e)
{
if (((RadioButtonList)sender).SelectedValue == "1")
{
if (odsAreasCU.SelectMethod != "GetAreasPubProyecto")
{
DropDownList ddl = ((DropDownList)dvCU.FindControl("DropDownList20"));
ddl.DataSourceID = odsNewObjetDataSource.ID;
ddl.DataTextField = "Name";
ddl.DataValueField = "CodObj";
ddl.DataBind();
}
}
else
{
}
}
When it passes over "ddl.DataBind();" line, a green arrow exception arises with the following message:
'DropDownList20 has a SelectedValue which is invalid because it does not exist in the list of items'
DropDownList20 is the one on this aspx page code:
<asp:TemplateField HeaderText="Area" SortExpression="Area">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList20" runat="server" DataSourceID="odsAreasCU"
DataTextField="Nombre" DataValueField="CodObj" ForeColor="#006666"
SelectedValue= '<%#DataBinder.Eval(Container.DataItem,"Area")%>'
Width="200px" ondatabinding="DropDownList20_DataBinding"
ondatabound="DropDownList20_DataBound"
onselectedindexchanged="DropDownList20_SelectedIndexChanged1"
AppendDataBoundItems="True">
<asp:ListItem Value="0">(sin área específica)</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
Any help or suggestion on this would be appreciated, i am really dissapointed with this bug.
Greetings.
|
|
|
|
|
Hi,
If you are trying to use the selectedvalue proeprty and the selected value does not fall with in the available value colections in the drop-downlist then you will get this error. It is preferred to insert the value in the drop-down list if it does not exist. Just check the sample code:
if (DropDownList1.Items.FindByValue("Gurgaon") != null)
{
DropDownList1.Items.FindByValue("Gurgaon").Selected = true;
}
else
{
DropDownList1.Items.Add(new ListItem("Gurgaon"));
}
I hope it helps.
Either you love IT or leave IT...
|
|
|
|
|
Thanks saanj, i'll try that.
|
|
|
|
|
hi,
im new using asp bt i have been using c# for bout 3 years but ive neither come across this problem before and need help.
ive current got a set of public variables declared and i have a start timer button that changes a public bool to true and and data to a string, ive added break points and the data is added when the button is pressed but when press the stop button the variables have changed to null it could be something basic but i cant seem to get my head round it so would appraciate any help on the matter
thanks marc
|
|
|
|
|
Can you post your code? That will help determine the problem.
|
|
|
|
|
i want to scan photo and documents according to diff-2 id and it save in folder.plz give me advice.
thanks and regards
vivek kumar
modified on Monday, May 4, 2009 1:44 AM
|
|
|
|
|
Hi,
This is Ravi Shankar. I had some problem with Globalization and Localization.
I have created one web form with name BillPrint.aspx and it contains labels like BillNo, ConnectionId and so on. I want to globalize the label’s text. I have created resource files for this with names BillPrintResources.en-US.resx, BillPrintResources.hi-IN.resx, BillPrintResources.resx. Which contains BillNumber as Name and “BillNo.” as value and similarly for ConnectionId as Name and “Conn ID” as value.
I had specified BillPrintResources for Classkey and BillNumber for ResourceKey in Expression property of BillNo label. Similarly for BillPrintResources for Classkey and ConnectionId for ResourceKey in Expression property of ConnectionId label.
After this I am building the website which it is showing some errors like
1.The resource object with key 'BillNumber' was not found.
2.The resource object with key 'ConnectionId' was not found.
Like this how many variables I had used the errors are coming for all.
Please help me in finding the solution.
Thanks & Regards
Ravi Shankar.
|
|
|
|
|
Hi,
I have two strings. I want to have one string to be left aligned on the listbutton and the other string on the right side of the same listbutton.
-Here is an example of what I'm trying to do. Look at the linkbuttons on this page(https://www.bwin.com/soccer) with the name of the soccer club and a number ie (Chelsea F.C. 1.43)
How do they left align a part of the string and right align another part of the string? I could not think of a way of doing it in CSS
|
|
|
|
|
1. I have one Text box (say first) and add button.
2. If i click add, one text box should be added + one delete button.
3. if i click add again, second text box should be added + one delete button and so on..
4. on clicking any delete button, the corresponding text box should get deleted
5. i also need to get the values of textboxes to be stored in the DB under one column name.
Kindly help me in getting this task solved using Asp.net, C# and Javascript.
|
|
|
|
|
Is this some kind of homework, similar question back to back. See my answer two entries down
|
|
|
|
|
Hi There,
I Want to know how to write or in switch case.
For Example I Had written Like this
case "A" || "B" || "C":
Even I tried With : and also with ,
Can anybody tell me how to do this.
Thanks.
|
|
|
|
|
|
Thanks For Reply.It Works
|
|
|
|
|
Hi All.
Please help me with this....
In my page i need one "Add" button so that if i click that button a textbox should apper however if i click the "Add" button again another text box should appear..
After entering values in the textbox....
When I give submit this textbox value should be saved in database..
Thanks in Advance..Sorry if i wasted your time
modified on Saturday, May 2, 2009 6:36 AM
|
|
|
|
|
In the Add event handler
TextBox txtbox = new TextBox();
txtbox.ID = some_known_id;
Page.Controls.Add(txtbox);
In the Submit event handler
use FindControl to get to your text box
TextBox txtbox = (TextBox)FindControl(some_known_id);
To make your life easier you can enumatate your text box id in a hidden control. Then on the server read the hidden control value and split the content to get to all your text box ids
|
|
|
|
|
And make sure you are creating your textboxes before page_load , otherwise It will not able to load viewstate or postback data,
|
|
|
|
|
Hi,
I need to display the 3 Lines of text in the alert Box in asp.net code behind
but '\n' is does not work. My coding is as follows
Page.RegisterClientScriptBlock("", "alert('Please Enter Date \n Please Enter Intime \n Please Enter Outtime')");
If any one know the solution Please send it immediately.
Bye.
|
|
|
|
|
Change \n to \\n. Therefore your code should be
Page.RegisterClientScriptBlock("", "<script>alert('Please Enter Date \\n Please Enter Intime \\n Please Enter Outtime')</script>");
|
|
|
|
|
Hi
Thank You so much for Your Reply.
It works well.
Bye.
|
|
|
|
|
Ramesh already answered your question
jai_101 wrote: Page.RegisterClientScriptBlock("", alert('Please Enter Date \n Please Enter Intime \n Please Enter Outtime')");
consider changing your message to
Please Enter : Date, Intime and Outtime
|
|
|
|
|
|
Panel is rendered as DIV tag in the client browser. Therefore you can print the content of a DIV tag. Check this link
|
|
|
|
|
i have to create a textbox, which is permanently available and a add
button.
the add button should create a textbox in its each click, so that 'n' number of textboxes can be created. (The created textbox should be available with a Remove Button so that the created textbox can be removed by clicking this remove button )
the target is to get the values of each textboxes created + the permanently available textbox.
i need to store the values of all these textboxes in to DB under one heading(one column name).
i need to try this out in Asp.net with C# (with the usage of Javascript to create Dynamic textboxes)
Plz help me out in getting this issue to be solved...
Ramkumar
|
|
|
|
|
No freaking home work, Plz
|
|
|
|