Hi, im new in mvc4 development, but i have some c# background. So, I started with a mvc 4 web application template and then I choosed the mobile application template.
Then, i started making tests, but i wanted handle events with javascript the client part, and the server side with c#. Then I do some tests and all worked great...
Now, i have more 'pages' than the home page, so i re-used that select because i need it all the time, so i have the select and when the selected value changes, the select fires the onchange event, but... all work great with one page, but when i select the
values from the select on the 'new' pages, definitely dont work. (example)
<select>
<option a>
<option b>
<option c>
</select>
localhost/Home -> If this is the first time I load the page, as i said , all works great, if I select some values, i can manage them.
Then,
localhost/Whatever -> Now i acces (by linking) to this page, (Lets we say the last previously selected option was B), now i can't handle another 'change' in the select, because I'll always see the B option as the selected one, (because it was selected previously).
If i do the same, starting with localhost/Whatever, and then select some values; but then change to localhost/Home, its the same...
it always show me the last selected option from the previously loaded page.
Below I'll attach the project then you can see what I say for yourself. You have a select, do some selects, then navigate to another page, select some values and you will see that those are the same as the previously values; it remain static as if the (change)
event is not fired. (I tried with the '.change' event from jquery and I get the same...)
Just a suggestion, but most people are likely to be cautious when it comes to downloading files if they are not absolutely certain of the contents. You might be better off posting the relevant portions of your code in the thread.
mserra
0 Points
4 Posts
--
Aug 17, 2012 10:30 AM|LINK
Hi, im new in mvc4 development, but i have some c# background. So, I started with a mvc 4 web application template and then I choosed the mobile application template.
Then, i started making tests, but i wanted handle events with javascript the client part, and the server side with c#. Then I do some tests and all worked great...
Now, i have more 'pages' than the home page, so i re-used that select because i need it all the time, so i have the select and when the selected value changes, the select fires the onchange event, but... all work great with one page, but when i select the values from the select on the 'new' pages, definitely dont work. (example)
<select>
<option a>
<option b>
<option c>
</select>
localhost/Home -> If this is the first time I load the page, as i said , all works great, if I select some values, i can manage them.
Then,
localhost/Whatever -> Now i acces (by linking) to this page, (Lets we say the last previously selected option was B), now i can't handle another 'change' in the select, because I'll always see the B option as the selected one, (because it was selected previously).
If i do the same, starting with localhost/Whatever, and then select some values; but then change to localhost/Home, its the same...
it always show me the last selected option from the previously loaded page.
Below I'll attach the project then you can see what I say for yourself. You have a select, do some selects, then navigate to another page, select some values and you will see that those are the same as the previously values; it remain static as if the (change) event is not fired. (I tried with the '.change' event from jquery and I get the same...)
http://www.sendspace.com/file/p4u4pa
So, whats wrong with that?
Please , help. Thanks.
Mikesdotnett...
All-Star
154927 Points
19867 Posts
Moderator
MVP
Re: --
Aug 17, 2012 09:02 PM|LINK
Just a suggestion, but most people are likely to be cautious when it comes to downloading files if they are not absolutely certain of the contents. You might be better off posting the relevant portions of your code in the thread.
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
ignatandrei
All-Star
135142 Points
21676 Posts
Moderator
MVP
Re: --
Aug 18, 2012 03:49 AM|LINK
Are you using FF or IE? I think FF has this behaviour....
Solution: on jquery init / javascript document ready function check the selected value and do it appropiate action in javascript.
mserra
0 Points
4 Posts
Re: --
Aug 27, 2012 08:39 AM|LINK
-
mserra
0 Points
4 Posts
Re: --
Aug 27, 2012 09:36 AM|LINK
-
mserra
0 Points
4 Posts
Re: --
Aug 27, 2012 11:27 AM|LINK
-