|
You're hitting an order of operations problem. If you add a control dynamically too late in the page lifecycle, then it's viewstate will never be restored.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for your reply Christian,
Is there a way I can work around this problem.. What would you suggest, again.. any tips would be greatly appreciated.
|
|
|
|
|
shivamray wrote: Is there a way I can work around this problem
Yes, create dropdownlist in Page_init event. Then viewstate will be maintained for this.
|
|
|
|
|
Thanks for your reply Navaneeth,
Can you please explain how to use the Page_init event to do this, also there will be multiple dynamically created dropdownlists depending on the users input, so there might be just 1 or up to 10 dropdowns, all subsequently created one after another everytime a the user casuses a "onchange" even to be fired.
To give you a better idea, here's what I am trying to do:
The user will enter a search string in a text box and hit the search button to bring back results from the db.
Two dropdownlists will be displayed after the search results are brought back, the first will display refinement options available, such as refine by price, color, size, brand etc. and the second will display the different values available for the refinement filter they have selected, for example if they selected "Refine by Brand" in the first drop down, the second list will display "Brand A", "Brand B", "Brand C" etc.
Once they select a value from the second list, an automatic post back will call the "CreateDropDownList" method to create a new row of dropdowns, again displaying the remaining choices of refinement left after they have made the first choice such as price, color, size etc.
If you can point me in the right direction with this problem I will greatly appreciate it.
Thank you,
Shivam.
|
|
|
|
|
Handle the LoadViewState event, which fires before page load, and do it there.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
how do i compile my project to create bin folder files.
Actully i want to know what are all files required for a website to get it displayed on internet...?
|
|
|
|
|
All the files you need to deploy a website are the .ASPX files and of course the .dll. Along with this you need all the image files you used.
You do not need the resource files as they are compiled into the dll.
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
Thanks for the reply.
But now can u tell me how to get that .dll files. as im not getting it in visual Web developer 2008. Whether it support making .dll or not..?
|
|
|
|
|
Sorry!
Here is a more acurate statement.
Website projets do not create a single DLL. By default, each page file has it's own DLL and the names are random. You can tell it to create a reproduceable name for each DLL, and using a website deployment project, you can tell it to create one dll, named whatever you want it to be
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
I am developing a Web Application in which I have included User Authentication.But the Session is not ending up even after logging out from the Application.That is,When Click Logout Hyperlink,It gets redirected to Logout.aspx.But when I click on the Back button of the explorer page it takes to my previous page with all the datas.How can I correct this?
FYI,
I am using
Session.Abandon()-To end the session
And I maintain a Session variable "Username" which is needed to be displayed in every page of my application.
Kindly help me out to secure my application...Thanks in Advance!!
Happy Programming!!!
|
|
|
|
|
SrividhyaS wrote: That is,When Click Logout Hyperlink,It gets redirected to Logout.aspx.But when I click on the Back button of the explorer page it takes to my previous page with all the datas
Your session is ending properly. But what you are seeing after pressing back button is browser cached version of your page. There are some techniques to avoid caching, but none worked correctly for me.
You need to check session in each page_load and if session not exist, redirect to login page. So when pressing back button, user can see the page, but he/she won't be able to continue with any operations. When page gets loaded, your session check function will redirect you to login page if it not exist.
|
|
|
|
|
Hi there, well is quite a lil problem as i also phase with same.
as u state that after logging out the page come with data on doing back... this is true as this page comes from the existing cache which already contains that page with all the data previously accessed, now if u do cntrl+F5 you didnt found any of the data on that page as now page get loads again....
Hello Forum
Always be in touch to help about the topic ASP.NET
|
|
|
|
|
Hi
I have a textbox, for that i want to validate using Regular expresson validator, i should accept only,
the numerics 0 to 9, after decimal only 2 digits, and also i should restrict a maximum of 7 digits like 1234567
if i use range and regular exp validator, while entering ',' both the validators are displaying error message,
so please guide me o achieve all the three validations in regularexpression validator
Thanks in advance
-
|
|
|
|
|
What code do you wrote for this?
What error it shows?
SSK.
|
|
|
|
|
|
Hi Nice,
I have a regular exppression to check price of product:
"[0-9]{1,3}(\,[0-9]{3})*(\.[0-9]+)?$|^[0-9]+(\.[0-9]+)?$"
This is expression accept number such as:
1.450,45.
5.120
45,26
...
Hope that help you.
vtkiet05
|
|
|
|
|
Hi All,
I need your help, i have 3 html pages and one aspx page.After
visiting the aspx page it creates one session variable this variable i
want to access in all my html pages thru anyway.
How can i access, give some idea is it possible or not.
Regards,
Madhuri.
|
|
|
|
|
First get the session variable via JavaScript (var u ="<%=Session("UserName")%>") on load page event and then show on HTML page.
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hi all,
I m executing my project in ie6. some times i use to execute my project in ie7
Here my problem is:
i m getting images well and good when i run it on the ie6 (my images are stored in my project in one folder) and in ie7 i m not able to get the images on my aspx page even though if the images are there on my image folder.But some times the images will disply on ie7.
plz any one can help..
Regards,
dharani.
|
|
|
|
|
hi ..
try to check wether ur img comes in run time or not so u should use alt property in ur code for ex
ur img name is log.gif means
|
|
|
|
|
how can i call excel into my website?
|
|
|
|
|
I have a problem, i hope that you help me to find the solutions:
I have a shopping cart to buy wines(assume url is www.winery.com). I allow user to register to create him store on my site to buy and introduce wines. when user registered successfully, he will open him site using url: www.winery.com/<registeredname>.
root url: www.winery.com
user1: www.winery.com/user1
user2: www.winery.com/user2
....
How can you help me?
Thank you and best regards
vtkiet05
-- modified at 0:27 Thursday 23rd August, 2007
|
|
|
|
|
very easily u can do it using System.IO, directory.Create("complete_path")
you must use MapPath to find the base path then append <registeredname> then call Directory.Create method
Nobody is perfect i'm Nobody
|
|
|
|
|
thank saifigr8, you mean after user registered, i must copy some template to folder has just created by user, because if i do not copy template to that folder, when user clicked url such as: www.winery.com/user1 the website will show.
Is that right?
vtkiet05
|
|
|
|
|
Hello Guys,
I need your help desprately! I have this DetailsView that has a DropDownList (as templated field). The DropDownList raises a postback event (onSelectedIndexChanged) and its handler performs a conditional operation that changes the HeaderText in one of the DetailView's fields.
I wrote the code, nothing special, then when I tested it worked only half the time! Sometimes the postback ocures but nothing changes on the DetailsView and the new value of the DropDownList does not show up. Can someone explain to me why this is happening??
Thank you
Grapes
|
|
|
|