|
Hi
I have a form which has a mixture of text boxes and drop down lists. The data that a user enters in through the form are sent off to a database query with the results appearing in a gridview on another page. To give the user flexibility the values they enter are stored in session variables, which after they have seen their results in the gridview page, they can click back and see their parameters. All of this works great, but I have a big problem in that the values on the form can't be changed!! Even though I can enter in new values on the form and click submit, when I see the results in the gridview, I am seeing the results of the first query, and when I click back I see the parameters of the first entry too!
Further, when I run the page in debug mode in Visual Studio 2008, I can confirm that the values in the textboxes and dropdown lists are not showing the amended values. In my submit button I do reset my Session Variables, and then give them new variables to hold by passing the values from the text boxes and dropdown lists.
So, my scratching head question is - why can't reset my form to show the new values I have entered in?
Can someone please help me!
|
|
|
|
|
check all the places your are setting the session variables.
It is very hard with out looking on the code to know what is going on. post some of the code snippets where you are setting your session variables
Yusuf
|
|
|
|
|
Hi
On my page load I have set a Session Flag called keepsession, which is set by the result page. If this flag is true on load of the page then the session variables, which are set when the submit button is clicked will pass the values from the sessions to the textboxes and dropdown lists, else nothing goes to them. This is working, because if I enter the form from a different part of the site, the boxes and lists are empty, which is what I want, and if I enter the page from the results page, the parameters from the first query are present.
The problem being is that I can't enter in new values to overwrite the old ones.
On my Page Load on the form page, I have
If keepsession = true then
TextBox1.Text = Session("var1")
TextBox2.Text = Session("var2")
Else
Session.Remove("var1")
Session.Remove("var2")
End If
On my button Submit
'Make sure sessions are cleared down
Session.Remove("var1")
Session.Remove("var2")
Session("var1") = TextBox1.text
Session("var2") = TextBox2.Text
'Stored Procedures go here to pass parameters to Db
Gridview takes the result from the stored procedure, which goes into a session variable. This session variable is taken in to a SqlDataSource called by the gridview to show the results on the second result page.
This is all I have done. It is not really complicated stuff.
On the debug in my button submit method and on the page load method the text boxes etc shows the values from the first query not the new values I have entered in
What do you know what the problem is?
|
|
|
|
|
AndyASPVB wrote: On my page load I have set a Session Flag called keepsession, which is set by the result page. If this flag is true on load of the page then the session variables, which are set when the submit button is clicked will pass the values from the sessions to the textboxes and dropdown lists, else nothing goes to them.
I'd simplify as follows
Create your session variables the first time you need it. From that time, I'd not remove them at all, either I set the value or I clear the value. Then
if session variables exist then load to the text box.
TextBox1.Text = Session("var1")
TextBox2.Text = Session("var2")
In this case it will have either a previous string or String.Empty whenever you clear it.
I think this will simplify your code and you can then debug it wherever your are settings/clearing it.
just my 2cents.
Yusuf
|
|
|
|
|
Try adding the following to the start of your form_load sub:
If IsPostBack then
Return
End If
If it works, it's because the submit button postback forces the form_load to happen, which resets the control values. The fix avoids that.
If it doesn't work, then I'm stymied.
|
|
|
|
|
May be it is because you are not refreshing the page.Just make a temporary
button to refresh dataset and gridview.
|
|
|
|
|
|
You should change the message title, for instance 'JOTD' looks more appropriate.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: You should change the message title, for instance 'JOTD' looks more appropriate.
and moved to Lounge.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
zarinapdm wrote: Hello friends Smile ,
I am looking for a personal tutor who may be able to teach me ANY of the following technologies:
- C#, ASP.NET 3.5, Visual Studio 2008, MSSQL 2008
- Siverlight, Ajax, Office Sharepoint Designer, designing websites within sharepoint.
- Web services, SOA, UDDI, SOAP, WSDL, XML
- WSS 3, MOSS 2007 Configuration and development
- Object oriented analysis and design
- PHP 5, MySQL
Please send your response to zarinapdmATyahooDOTcom.
This is an obvious attempt at harvesting email addresses for some nefarious purpose.
zarinapdm wrote:
I have an interest in travel and software development.
I'm willing to bet that most of the people here share the same interests...
zarinapdm wrote:
so receiving personal coaching in another country is what I am looking for.
Sounds like you need to find a hooker.
zarinapdm wrote:
I have some analysis and programming experience. Your role is to teach me step by step ANY of the above technologies within 6-8 weeks.
Is six weeks really enough?
zarinapdm wrote:
You should have least 5 years of work experience in ANY of the above set of technologies. You should have the ability to teach technical concepts to others.
It still sounds like you need to find a hooker.
zarinapdm wrote:
You must speak English.
DAMN! I was *almost* qualified!
zarinapdm wrote:
*** Time: Around June-July 2009 or to be arranged.I can personally come to your country to be your student.
This will only work if all of these requiremebnts are met:
a) you're a female
b) you're hot
c) you can't out-run me
d) you can convince my wife it really is programming I'll be teaching you
zarinapdm wrote:
*** Hours of personal tuition required:2 hours per day. 6 days, approximately up to 8 weeks (2*6*8=total 96 hours)
First it was 6 weeks - now it's 8. So which is it? (I don't know if I can fool my wife for the extra two weeks).
zarinapdm wrote:
*** A Single room or shared accommodation is required near your area.Room Budget is China Yuan Renminbi 1200 per month or 300 per week.
Well, that pretty much kills convincing the wife...
zarinapdm wrote:
*** My budget for your personal tuition is China Yuan Renminbi 1200 per month or 300 per week.My total budget for tuition and accommodation per month is Renminbi 2400. Or equivalent currency. It is what I can afford at the moment. These rates are slightly negotiable.
So how much is that in English?
zarinapdm wrote:
I will pay 20% bonus for being a good host.
It still sou8nds like you need to find a hooker.
zarinapdm wrote:
===============================================
The above message is not valid after Dec 2009.
===============================================
I don't like time limits.
"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
|
|
|
|
|
John Simmons / outlaw programmer wrote: ===============================================
The above message is not valid after Dec 2009.
===============================================
I don't like time limits.
Even if the time limit is after the teaching date? Lesson number 1 should be - December comes after June/July.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys
|
|
|
|
|
China Yuan Renminbi 1200 = ~$175 US ... good luck with that ... although I suppose in come countries that is a fortune ... but probably not many of the ones where English is a primary language
he would be better off using the money to get good internet access and look for free or very low cost online courses.
...now where is that black rose...
Steve
_________________
I C(++) therefore I am
|
|
|
|
|
I do not like your hooker comments. It reflects your own culture only.
I just want to learn the technology.
|
|
|
|
|
zarinapdm wrote: I do not like your hooker comments. It reflects your own culture only.
I just want to learn the technology.
Oh ya! hookers make more than what you put on the table
Yusuf
|
|
|
|
|
Steve had the best recommendation - get a good net connection and start learning....
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
zarinapdm wrote: learn the technology.
of what? The way original ad was posted demonstrates your attitude and (mis)demeanour lucidly.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
zarinapdm wrote: I do not like your hooker comments. It reflects your own culture only.
You mean they don't have prostitutes in China? Besides that, what you like and dislike about my post doesn't affect me one way or the other, because yours was so laughably off the mark that I felt compelled to waste your time.
zarinapdm wrote: I just want to learn the technology.
Then get off your lazy ass and learn it. You can certainly do it without spending money and imposing your presence on someone in a foreign country.
Finally, this is NOT the place to look for a personal tutor. Ask specific questions about a particular problem you're having, or read the appropriate articles.
"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
|
|
|
|
|
dude i don't think he was looking for your support or agreement in his comments
"mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them"
|
|
|
|
|
Over the centuries students went on traveling to far away places in search of great people to learn from them. They have took back the whatever they have learned and applied that knowledge to their local community. That tradition is now forgotten.
I am basically applying a similar principle. I learn better and faster when an expert explain the concepts to me. Online learning supplements it. Unfortunately there are so many crazy people out there, they tend to look at my request negatively.
Conquer the ill-natured man by goodness.
Conquer the miser with generosity.
Conquer the liar with truth.
...Buddha
|
|
|
|
|
zarinapdm wrote: Over the centuries students went on traveling to far away places in search of great people to learn from them.
Here, that is called univerisity and it happens every year.
zarinapdm wrote: They have took back the whatever they have learned and applied that knowledge to their local community.
I go out to conferences and bring back what I learn and tell my colleagues and present to my local user group.
zarinapdm wrote: That tradition is now forgotten.
The tradition is still there, but just not in the specific form you are looking for.
zarinapdm wrote: I am basically applying a similar principle. I learn better and faster when an expert explain the concepts to me.
Indeed, I do too.
zarinapdm wrote: Unfortunately there are so many crazy people out there, they tend to look at my request negatively.
There may be a cultural clash. Try not to get too put off by it. Look for a different way to express what you want and you may find it better received.
For example, I find that people from India that speak English but that are not aware of the cultural conventions of English speaking countries sound very demanding and also insincere in their attempts at politeness.
|
|
|
|
|
One more point:
I earn less than $4/hr for my IT related work. In USA a person doing the same IT work earns $50-$80/hr! That means my purchasing power is extremely low in the international market.
Obviously I cannot afford to travel and study in Europe or USA. However I am hoping to find IT teachers in the developing world, such as India, China, Philippines, Vietnam.
|
|
|
|
|
John Simmons / outlaw programmer wrote: you can't out-run me
Don't have to be faster than the bear, just faster than you.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hi ,
Im using a repeater controll in asp.net 2.0 , in that controll thee is a link button the the ItemTemplate of the repeter , although the we form is working fine on ym loca pc but while i delpoy it on the server it gives me this error :
Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
Please could any one direct me ? im populating my repeater like this :
If(!IsPostBack)
{
my repeater control gets populated from database();
}
Also i am using RepeaterItemDataBoudn and repeaters ItemCommand events , to trapp the event when the link button inside the repeater is cliked .But this click is not getting trap with the repeaters event while I had deploye the web form on the stagingin server , and is working fine on my local machine . Help required immediatly ive enabled EventValidation to treu as well ....
Fad .
|
|
|
|
|
I know how to upload a file to a webserver with the asp:fileupload control. What I really need is:
1.Upload a html file (filupload)
2.Open the file and read the content to extract all the files path. (src) 3.Upload all the files to the server that were found on the html file.
The 3rd step is the one I can't figure it out. I have tried file.copy. It works fine if the files are on my local computer. If I choose a network drive i'm getting and error "Part of the file path is missing or wrong" and is because file.copy doesn't have rights read from a network drive. Fileupload does. (Same folder)
|
|
|
|
|
You can't do what you want because of two things:- The Web server (which usually is NOT on your computer) can't access the files on the client computer (which sometimes is your computer) except in the very rare circumstance of when the server and client are the same like in your development environment.
- You can't have a browser upload a file that the user hasn't specified. That would be a major security risk if you could.
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|