|
The reason is that asp.net uses something called ViewState[^].
If you modify the html on the client via javascrit, that html is gone when the page posts back to the server.
I didn't get any requirements for the signature
|
|
|
|
|
Hi,
Thanks for your reply. Please tell me the solution.
Thanks.
|
|
|
|
|
If you are using .net 2.0 or higher. I suggest using AJAX and writing server code to populate the drop down.
Do you understand why it is that if you populate a dropdown with javascript you're going to have to re-populate that list after every postback?
I didn't get any requirements for the signature
|
|
|
|
|
newOpt = document.createElement("OPTION");
newOpt = new Option(nodval,nodval);
libox.options.add(newOpt);
try this..
Rajendran.AL
|
|
|
|
|
Hi,
Thanks. I have used that option only. But still after the postback the filled items gone.
|
|
|
|
|
send me your code
Rajendran.AL
|
|
|
|
|
var ddlVendor = window.opener.document.getElementById(gId);
//Clears the combo box contents.
for (var count = ddlVendor.options.length-1; count >-1; count--)
{
ddlVendor.options[count] = null;
}
var vendorNodes = listNode.getElementsByTagName('Table1/Name');
var vendorIds = listNode.getElementsByTagName('Table1/Id');
var textValue;
var idValue;
var optionItem;
//Add new vendors list to the vendors combo box.
for (var count = 0; count < vendorNodes.length; count++)
{
textValue = GetInnerText(vendorNodes[count]);
idValue = GetInnerText(vendorIds[count]);
var newOption = window.opener.document.createElement('OPTION');
newOption.text = textValue;
newOption.value = idValue;
ddlVendor.options.add(newOption);
}
ddlVendor.selectedIndex = count-1;
|
|
|
|
|
check the for loop....length and count condition..
Rajendran.AL
|
|
|
|
|
Mahesh.J wrote: any server event
The server event resurrects the values from a statebag called ViewState. You ought to rebind your JavaScript dropdown again.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
All the world's a stage,
And all the men and women merely players.
They have their exits and their entrances;
And one man in his time plays many parts... --William Shakespeare
|
|
|
|
|
I have a Sub Routine as below:
Private Sub SaveRecord()
Call InsertIntoTable1
Call InsertIntoTable2
Call InsertIntoTable3
Call InsertIntoTable4
End Sub
I want to use the transaction object in such a way that it starts just before the first Insert Call and ends after the last Insert Call. The situation is that I have to save records in each table using different procedures.
Presently, if suppose records are successfully inserted in First and Second Tables and if insertion fails in Third Table then the entries done in First and Second Table must rollback.
How it can be done?
kissy
|
|
|
|
|
|
So, I just listened to podcast #6 from stackoverflow.com and I was amazed when Joel Spolsky described how he structures his own ASP.NET applications. Not that there's anything wrong with it but it was just very different than how I do it.
He said that usually he has few pages and then a big switch that switches on verbs in the request address. The various case statements then makes a user control visible which then handles the actual action.
Personally I just like to have many very small pages with small responsibilities (obviously I´m mainly talking about actual web applications and not web sites) since I like it clean and lean.
Anyway this made me curious as how different people structure their ASP.NET apps. So how do you do it?
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
Thats an interesting post but it should go in the lounge forum.
I agree with you, keep the pages clean and easy to amend or to pass on to other developers
We are not a Code Charity
|
|
|
|
|
Rohde wrote: I just listened to podcast #6 from stackoverflow.com
Good one. I was not aware of this. Thanks for posting
Rohde wrote: Anyway this made me curious as how different people structure their ASP.NET apps. So how do you do it?
I used to consider easy maintainability while designing application. Business objects and data objects will be in separate projects. Business objects will be loosely coupled which helps to test the code easily. It also helps to improve portability and not depended with ASP.NET. I used to do dependency injection kind of design for the business objects, so that Data access objects can be easily mocked while testing.
I too create many ASPX pages. If any user interfaces are repeating in more than one page, I used to wrap it in custom controls.
|
|
|
|
|
N a v a n e e t h wrote: Good one. I was not aware of this. Thanks for posting [Smile]
Well, basically Joel Spolsky and Jeff Atwood (from codinghorror.com) are collaborating on creating stackoverflow.com which is to be some sort of developer resource, wiki, question/answer digg-kind of thing.
And so far they have recorded 6 podcasts wherein they discuss their idea about stackoverflow and various technical programming issues as well. Pretty interesting stuff.
N a v a n e e t h wrote: I used to consider easy maintainability while designing application. Business objects and data objects will be in separate projects. Business objects will be loosely coupled which helps to test the code easily. It also helps to improve portability and not depended with ASP.NET. I used to do dependency injection kind of design for the business objects, so that Data access objects can be easily mocked while testing.
Yeah that's pretty much as I do as well. Although I haven't used DI too much; but I'm migrating towards it.
"When you have made evil the means of survival, do not expect men to remain good. Do not expect them to stay moral and lose their lives for the purpose of becoming the fodder of the immoral. Do not expect them to produce, when production is punished and looting rewarded. Do not ask, `Who is destroying the world?' You are."
-Atlas Shrugged, Ayn Rand
|
|
|
|
|
I know people probably won't agree with me...
But I only separate data / business rules / presentation if I know that I will need to use the code elsewhere.
I am fully aware of how to create classes that represent objects in my database. I also know how to use a generic list (of those objects) as a datasource.
That being said I often write stored procedures to be used only in one web page and just use a datareader right in the code behind. It is quicker to write, easy to debug / modify and just simpler.
I have been programming asp.net for the last 7 years and I went through a phase where I would "architect" everything. But then I found that I would end up with more bugs and have a tougher time "jumping back into the code" if a major change was requested. So now I try not to architect too much and just keep it simple.
Just my two cents. I also use lots of user controls and web pages. I try not to clutter up my aspx pages with too many controls...
I didn't get any requirements for the signature
|
|
|
|
|
ToddHileHoffer wrote: But then I found that I would end up with more bugs and have a tougher time "jumping back into the code" if a major change was requested. So now I try not to architect too much and just keep it simple.
I can't agree fully. AFAIK, if you have automated unit test cases, you can do this more easily. You can easily find out the areas which are breaking. Right ?
|
|
|
|
|
Well, I never did any "unit test cases".
Its not like my code was broken just the occasional object reference not set...
I didn't get any requirements for the signature
|
|
|
|
|
Hi i used ajax cascading dropdown for my dropdown list,
When one drop down will select based on that another dropdown will get datas...,
The same thing one of my colleague did using update panel...,
so if it will work in update panel itself then whats the need of ajax controls?,
I feel what are the things can do in ajax same efforts we can do it in update panel also...,
Then y we are going for ajax controls???...,
Plz tell me some guidens abt that...,
else forward me some good sites to differentiate those...
Thanks & Regards,
NeW OnE,
please don't forget to vote on the post
|
|
|
|
|
Update panel also AJAX extension....
Rajendran.AL
|
|
|
|
|
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript"> function call1() {
var textvalue;
textvalue=document.getElementById("txtfilename").value;
var image=document.getElementById("TextBox1").value;
// var v1="YouTube - Hahaha.flv";
var s1 = new SWFObject("mediaplayer.swf","mediaplayer","400","220","8");
s1.addParam("allowfullscreen","true"); s1.addVariable("width","400");
s1.addVariable("height","220"); s1.addVariable("file",textvalue);
s1.addVariable("image",image); s1.write("container");} </script&g
media player will be open but the file not play pls help me
|
|
|
|
|
This person needs to learn to put a suitable subject rather then 'question'
We are not a Code Charity
|
|
|
|
|
.netman wrote: This person needs to learn to put a suitable subject rather then 'question'
Yeah. Sure. That will happen...
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
This is not an ASP.NET question. It's a javascript question. The web development forum is a better fit.
Every first post in this forum is a question. Hwo do you think that 'question' is a helpful subject ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Every first post in this forum is a question. Hwo do you think that 'question' is a helpful subject ?
Have you checked out this guy's post history? Its worth a laugh
|
|
|
|