|
can someone help me out with the code in C# to cascade the dropdownlists without postback event ... im using MS visual studio .net 2003 ..where i cant use ajax .... the scenario is " .. i have four dropdownlists ... and wen i select an item fromthe first dropdown say("D1") the corresponding values for tht selected item shld get populated in the second dropdown say (D2).. and is the same with the other dropdowns as well ....
modified on Tuesday, September 9, 2008 1:59 AM
|
|
|
|
|
if you can't use javascript and you don't want to use postbacks then I don't think it is possible...
|
|
|
|
|
jaya86 wrote: without postback event
Why you don't want postbacks?
If you want to use AJAX control then here is that control ?
http://www.asp.net/AJAX/AjaxControlToolkit/Samples/CascadingDropDown/CascadingDropDown.aspx[^]
Another alternative is using javascript
There is one more method called PageMethods using AJAX search for it that can also help you
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi,
Use JavaScript for that. Please check the JavaScript codes here:
http://javascript.internet.com/forms/country-state-drop-down.html
http://javascript.internet.com/forms/dynamic-drop-down-list.html
Call the function in Attribute Collections, like
DropDownList1.Attributes.Add("OnClick",....);
Hope this helps.
Success is the good fortune that comes from aspiration, desperation, perspiration and inspiration.
|
|
|
|
|
Hi all,
How can i add tooltip for a hyperlink in a row of a dataview ctrl.pls help me out.
Thanks in Advance.
|
|
|
|
|
First thank you for your helping mind.
I need some idea from you.
I am designed one form in asp.net. (using coding in Visual Basic)
Using more than one textbox control in a form.
Each control fixed tabindex starting from 1 in sequential order.
Now run this program, I give a value and press enter key the control
passing to next control. this process is ok for more than one textbox control is using.
But I restrict the textboxes in run time of displaying a form.
This time only one textbox is display the form and one command button. In this case, I give some value in textbox press enterkey but the controll not to go to next control, the next control is command button (OK).
In this time using only tab key is used.
But I want to press enter key the control move to next control of command button is activate and form is refresh to next input.
How to solve the above problem?
thanking you
abglorie
|
|
|
|
|
Hi friends
In my project,the image display dynamically in aspx page.how can i export image in excel,pdf file
thanks regards
sara
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
In the appSettings section of the Web.config I want to store 'complex' types such as Collections.
Currently to achieve this I am using class libries with a Settings.settings file which allows this (with a nice interface). But I want to move the data to the Web.config file as this will allow me to change the values at runtime (essential).
Does anyone have any ideas on how I can do this? At present, I am simply delimiting the entries with a special character. I fear this may be the best solution...
cheers.
|
|
|
|
|
Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again.
|
|
|
|
|
I understand the Web.config
But if I change a variable in the appSettings section on the server, then it will update live and users sessions are not lost - they get the new value and their session is maintained.
But my question is about storing 'complex' types.
|
|
|
|
|
boy.pockets wrote: But if I change a variable in the appSettings section on the server, then it will update live and users sessions are not lost - they get the new value and their session is maintained.
I believe, that not going to happen.
boy.pockets wrote: But my question is about storing 'complex' types.
All serializable collections can be stored in XML files.
|
|
|
|
|
Web.config is a Configuration file which help in setting up of a website. Change the Web.config at runtime will restart the application (i.e) all the session information will lose. You have to start the application again.
The storing your 'Complex' collections in Web.config which is changing at runtime is a bad idea. Try to use XML files.
|
|
|
|
|
Thanks for taking the time to answer again.
I hear what you are saying about xml files and will look into it (i know you can specify an 'external' file to extend the appSettings section).
my experience is at odds with what you are saying about changing Web.config appSettings entries at runtime and loosing session information. Because I believe I am already doing it (I might be mistaken). Perhaps you could point me to some articles/doco backing up your point of view?
|
|
|
|
|
Here is the answer i was looking for:
mysteries of configuration
anyone making a medium-large scale web site should know about this
|
|
|
|
|
Hi,
I've custom error mode set to "On" and defualt redirect to error.htm in my web.config. In all other cases of error it displays the error.htm page. When sql server was down it displayed the error, "Runtime error , please turn off custom error mode in web.config to view error."
How do i avoid even this kind of runtime error getting displayed to end user. Please calrify.
Thanks,
Priya
|
|
|
|
|
maybe recreating the error and looking at the Page_Error method where you can handle the error manually.
as an aside:
for customErrors set mode = "RemoteOnly"
that will mean that externals will not see the error, but you will be able to see the error from the local box.
|
|
|
|
|
Hi All
Slowly getting through my 1st asp.net page but need to pick your brains (again!)
Basically I'm pulling data from an excel sheet, one of the thing's I'm doing with the data is making a url link, if there's text in column 2 then that's to be the text for the link, if there isn't then the text in column 1 is the text for the link.
Problem is, as there doesn't necessarily have to be text in column 2 I'm getting a dbnull error. Below is my function and the asp code refering to that function. I know I need to put some error handeling but my big question is where? Is it within the function or within the asp link?
Function MakeLinkText(ByVal name As String, ByVal description As String) As String
If description = "" Then
name = name
else
name = description
end if
return name
End Function
<asp:TemplateField HeaderText="LinkText"><ItemTemplate><%# MakeLinkText(Container.Dataitem("title"), Container.Dataitem("refer to")) %></ItemTemplate></asp:TemplateField>
I did try on error resume next within the function but still got the error (I realise thats very bad practice, I was just trying to narrow down the cause of the error.
Appreciate a point in the right direction.
Rgds
gerryR
|
|
|
|
|
Try if string.IsNullOrEmpty(description), assuming this is the point of error. In C#, you can do ?? string.Empty to turn null into an empty string.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
In Visual Basic you can test for DbNull using
If IsDbNull(whatever) Then...
Howver, nb that you will need to re-write your function without explicitly defining the type - eg
Assuming "name" is never null, but description might be:
Function MakeLinkText(ByVal name, ByVal description) As String
If IsDbNull(description) Then
Return CStr(name)
Else
Return CStr(description)
End If
End Function
|
|
|
|
|
Thanks once again Phil, workes perfectly!
One question, if I leave the CStr out it still seems to work, is there some other reason for having it in other than just good code practice? (not that that's not reason enough!)
Thanks again
gerryR
|
|
|
|
|
Well, not really... only that as the type is not explicitly defined it just takes care of any situation when you might call the same function from somewhere else with different data types...
|
|
|
|
|
yes ... if you make Option Strict on then CStr is necessary....
Abhishek Sur
|
|
|
|
|
Folks
Iam doing an application which is an EXE.What I want to achieve is, upon clicking on that exe in desktop,it should automatically check whether the user in windows authentication ( User ID and Password used in windows login )is there in DB or not. If the username and password of windows matches that in DB, then the user should be given access and directly the the Form( Simple form with a button I design for test purpose) I design should open. Else, it should display an message that " You are not the authenticated user for to access this application".
Like, there can be many users logging into a windows system. but only selected users have the access to that particular application. It should be done without knowledge of user at the backend.Only in failing cases, it should display the message " You are not the authenticated user for to access this application".
else it should go to that Form page I have designed.
Please please, some folks help me in this as its very very urgent and important ....I will be very thankful to you ....Please paste the entire code with some comments ( As Iam new to this )..
|
|
|
|
|
rajanarayanansabarish wrote: Please paste the entire code with some comments
www.rentacoder.com[^]
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
rajanarayanansabarish wrote: Please please, some folks help me in this as its very very urgent and important
But not important enough for you to post in the right forum ? This is not an ASP.NET question.
rajanarayanansabarish wrote: ( As Iam new to this )..
Then why do you have a task that is 'very very urgent' ??? Have you taken a paid job you can't handle ? This doesn't sound like homework to me.
rajanarayanansabarish wrote: Please paste the entire code with some comments
Code Project has a jobs area, you should perhaps subcontract the work you can't do. Although, it sounds like that will be all of it, and I'd guess you have no margins to subcontract, you're in fact an example of why outsourcing doesn't work. b/c incompetent people bid low on jobs they can't do, and hope for sites like this to do the work for them.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|