|
Good day.
First, I have to ask, to please excuse my English.
I have an aspx page with 5 comboboxes on it. The 2nd combobox's details is dependand on the 1st one's selectedValue and combobox 3,4 and 5 is dependand on combobox2's selectedValue. Auto-postback is enabled on both combobox 1 & 2.
Whenever I choose a value in combobox 1, the data in combobox 2 gets updated and the first item in combobox2 is automatically selected. The problem with this is that data in combobox 3, 4 & 5 is dependant om the selectedValue of combobox2 and also needs to be updated with the new selectedValue of combobox2, but it does not get updated when the selectedValue of combobox2 changes as a result of the change in combobox1.
The problem exists when a users choice is the value already selected in combobox2, then the data for comboboxes 3, 4 & 5 aren't populated correctly.
It doesn't help disabling of hiding comboboxes 3-5 and only enabling it when the selectedValue of combobox2 changes, because the user will still click on the same value already selected, and the event will not fire.
I also tried adding a "empty" value to the combobox and selecting it as default, but this will lead to a foreign key violation in the databse.
The question is...
Is there a way, that I can (without adding an empty entry in the database - bad practise) set the initial selected item to a blank entry, thereby forcing the user to change the selected index?
I'm currently using ASP.Net 2.0 and the back-end code is in C#. I can make use of Javascript, but the application I'm developing doesn't work all to well with AJAX.
Thanks in advance.
JD Stuart
|
|
|
|
|
jdstuart wrote: The question is...
Is there a way, that I can (without adding an empty entry in the database - bad practise) set the initial selected item to a blank entry, thereby forcing the user to change the selected index?
After binding the drop down list, insert a new item at the 0th position.
DropdownList.DataBind();
DropDownList.Items.Insert(0,"Select one")
|
|
|
|
|
The problem however exists when the user doesn't choose one, then the entry into the database would render the foreign key constraint invalid.
|
|
|
|
|
Before doing insertion, check if the SelectedIndex is 0 ? If it is 0, display a message to choose the item.
|
|
|
|
|
I found a way of getting around this problem.
After the data is bound to the combobox. Write: combobox.items.insert(0, new ListItem("Choose one", "-1")); then add a required field validator that validates the value of the combobox, but set the InitialValue property of the validator to "-1".
This allows the combobox to be validated without the need of a postback.
|
|
|
|
|
I have a wrox instant results cd that has a chat application that works great on my dads computer but will not perform on my newer more powerful dell. I perform the exact same steps on both units. both units have xp professional and visual basic express 2005 installed from the same cd. Both units the same cd's one works the other does not.
Can anyone help me??
|
|
|
|
|
Unless you provide more specific information, like details of the error you are getting, it's unlikely anyone will be able to help you. The people on this forum specialize in software development,not mind reading.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Im not getting any errors the chat window does not appear above the text enter texbow
|
|
|
|
|
Have you maybe tried one of the WROX forums?
|
|
|
|
|
Read through the scenario.
client A wants to read files from another client B present in the same network. But this reading should be done through a ASP.NET web application . In other words a client should be able to read a text file present on another client in the same network.
This scenario would be applicable in an intranet application. The thing <code>to note is that the path of client B would be present in the server. The client A would pick the path from the server and navigate automatically to client B, hunt down the necessary folder and read the text files and store the necessary data in a database.</code>
This was my earlier post yesterday. I intend to carry this forward for gathering more insight. Here is the code on which I am working
<br />
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
DataTable dt = new DataTable();<br />
<br />
<br />
StreamReader sr = new StreamReader(@"\\Pc4\C$\NDP\Test1.csv");<br />
string line;<br />
while((line = sr.ReadLine()) != null)<br />
{<br />
Label1.Text += line;<br />
<br />
<br />
}<br />
<br />
}
The client A when he executes this code is intending to access another client B (Here it is PC4 in the same domain).
In my web.config I have <identity impersonate="true">. The code resides on server in Win 2K3 box.
This program works fine when I am executing it from the server, but fails from a client. Any pointers or are further clarifications required?
|
|
|
|
|
What user context are you running the application under?
|
|
|
|
|
I have identity impersonate="true" in web.config. In the Directory security I have Anonymous Access and Windows Authentication turned on.
|
|
|
|
|
Hi friends
How to check the LAN connection status using vb.net 2003(webapplication )
Regards
saravanan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
|
my .net application is nw running in mozilla how change it to Internet Explorer
|
|
|
|
|
Right Click on the aspx file in Solution Explorer.
Choose Browse with... option.
Select your browser.
oops I nearly forgot. You can press the Set as Default button to make it default browser for your .net applications
|
|
|
|
|
hello guys;
i developed a s/w whic let the user upload an image to our server.
Now i need to display all the images in that file on the web page, regardless of the name .
please if some body could help i'll be greatfull
thanks in advance
|
|
|
|
|
Hi ,
i have a question. in asp.net pages and with asp.net controls, i can do localization by using resourcekey property. But i need to use localization with html controls. i try it with the same way in asp.net controls but it doesn't work. is there any way use it with html controls?
Thanks
|
|
|
|
|
Hey
How can i get Gridview to show data Vertical and not horizontal in c# ?
Thanks very mutch..
|
|
|
|
|
use detailview to show vartical
siri
|
|
|
|
|
how should i introduce the auto increment field in the cross tab crystal reports in asp.net 2.0
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Using .Net 2.0...
When a user logs in to my site, I set a few session variables with his user info. When the user clicks "logout", a logout page is loaded that clears the session variables completely (with Session.Clear(); ) and redirects to Default.aspx. However, after logging out, if the user manually types in the url for a members-only page, it appears to still think they're logged in. It's almost like the browser has cached the members-only page.
Did I explain that okay?
Is there a way to clear specific pages from the cache?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Use following line in the Page Init/Load of the specific page you want to remove from the Cache,
Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache);
HttpCacheability also has few more enumerations.
|
|
|
|
|
I was actually looking for something that I coudl use at the point the user logs out, like being able to tell the browser to remove certain pages from the cache.
I've already tried the thing you suggested (in Page_Load of the given pages), and it's too heavy handed (I need to keep some variables around that can't be put in the Session vars.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Are you sure that session is cleared ? I had the same issue. When URL's are typed straight, it loaded the page. But it will redirect when we hit F5. Is it redirecting for you ? Disabling caching methods didn't worked for me. I think it's browser behavior and we can't control much.
|
|
|
|