|
To your comment for that answer "Not Clear sir,I'm new to MVC.", please read that article I have attached.
The answer to that (sorry for going off-topic related to this thread), is that you need to send the information about your View and some other controls which were interacted through user. Which is a very common task in WPF, or Win Forms. If you view event handlers in those frameworks you find out this code,
void button_Click(object sender, EventArgs e) {
var button = sender as Button;
var name = button.Name;
}
In which, sender is the object which triggered this event. So, if you cast it to a Button object and so on.
In ASP.NET you do not get such functionality by default, which is why you have to create such functionality yourself. Which, in my opinion would be best to use native forms. Which get submitted (using action attribute) to their own pages for processing. So you can redirect the user to where you want him to be. This way, you will check for values that are related to the controller action; SignUp or SignIn . Do not complicate things, use the simplest method that can be used. It was also pointed out, that you're having variables for your HTTP GET handler, not HTTP POST. Use a model to establish similarity, or... You can use JavaScript to control how things are handled on the client (handling click on SignIn or SignUp).
Also what he tried to tell you was same, that you were having the member profileList inside your GET handler, but not inside the POST handler, where as once the form was to be submitted, it was using the POST handler action, so there was a mismatch between the ViewBags and thus caused this problem. That is why he suggested that you use a Model.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I rarely found such a good training site in my life
Thank you very much
|
|
|
|
|
you are welcome.
நெஞ்சு பொறுக்கு திலையே-இந்த
நிலைகெட்ட மனிதரை நினைந்துவிட்டால்
|
|
|
|
|
Yes, here is an article[^] that I wrote for beginners like you. You can read it, it will guide you throughout the basics of ASP.NET MVC framework.
I hope you will find it helpful.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
|
Thanks a lot for these very helpfull information. Much better than what I found so far
I have another one
The views I found in many examples contain more or less a lot of html-code. Is is possible to use a kind of "graphical html-designer" to create this native code automatically?
|
|
|
|
|
I just learned MVC as well, oh it was painful. Totally different than web forms.
I started with one of the generic projects in VS 2013 Community Version, in which a tutorial existed for it.
This is one of them
Learn MVC (Model View Controller) step by step in 7 days – Day 1[^]
So I download the VS2013 Community Version
Fired it up, updated the program first.
Created a new Project, ASP.Net MVC 4 Web Application, and selected Razor for the HTML in the View
Then used package manager and updated all the packages to MVC5 and so forth.
From There, it creates a Responsive Design Website with login and register for accounts
So I decided to make a new website for myself and learn at the same time.
There is a preview, but basically, you write HTML off the top of you head, and just used a browser to test it.
The designers are stupid anyways and produce poor results anyways.
|
|
|
|
|
Hi,
How can I change the date format of textbox , textmode=date?
By default its yyyy/mm/dd and I want to change it to mm/dd/yyyy
asp.net visual studio 2013 framework 4.5
|
|
|
|
|
Do you have any Datepicker on Textbox ?
நெஞ்சு பொறுக்கு திலையே-இந்த
நிலைகெட்ட மனிதரை நினைந்துவிட்டால்
|
|
|
|
|
No its simple textbox with date as a text mode. but the problem is I can find any option to change the format.
|
|
|
|
|
Then ,How the user Select the Date? by typing?
நெஞ்சு பொறுக்கு திலையே-இந்த
நிலைகெட்ட மனிதரை நினைந்துவிட்டால்
|
|
|
|
|
Ops sorry I misunderstood your last message. Yes its date picker. but the format is yyyy/mm/dd.
|
|
|
|
|
Is that Ajax Calender or Jquery Calender?
நெஞ்சு பொறுக்கு திலையே-இந்த
நிலைகெட்ட மனிதரை நினைந்துவிட்டால்
|
|
|
|
|
Setting TextMode="Date" will render an HTML5 date input[^] control. This has limited browser support[^], and doesn't provide any way to override the date format.
There are two date formats in play:
- The wire format, which is how the date is sent to the client, and how it sent back to the server.
This is required to be yyyy-MM-dd in all cases; - The display format, which is how the date is presented to the user.
This is not part of the specification, so browsers are free to do what they want.
Chrome and the latest version of Opera currently use the user's local date settings.
Browsers which don't support the date input will fall back to a text input, which means they have to use the wire format.
You'll probably want to use a polyfill to get the control working in all browsers. For example:
https://github.com/chemerisuk/better-dateinput-polyfill[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
but last time I used the same it was showing mm/dd/yy format.
|
|
|
|
|
Then either you were using a different browser, a different version of the browser, or you had different regional settings.
The wire format is always yyyy-MM-dd . The display format depends entirely on the browser.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
No I am using the same browser I don't know whats wrong I will find it out. Thank you for your reply
|
|
|
|
|
If it's Chrome, you've probably had several dozen new versions since you saw the mm/dd/yyyy format.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Yea that can be possible.
|
|
|
|
|
How do I pass an ID? It will need to be dynamically generated when the class is called.
thanks
|
|
|
|
|
For this ID to be generated dynamically, you should give Guid object a look. It would generate a new random ID on the run time. Read more about it on MSDN[^]. Example code to generate the unique ID is,
var guid = Guid.NewGuid().ToString();
Now pass guid to the function or where-so-ever you want to pass it to.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
You have to design your program, in which you generate an ID
And store it somewhere.
So if the ID is a database table ID. you add the record and go back and get the ID of it
Or you can use a date / time down to the millisecond
As far as storing it, you can store it in a invisible textbox. or a query string.
Your description of a custom validator is quite vague, Javascript?, then pick up the ID in the textbox.
|
|
|
|
|
|
Going to need a few more details there. What exactly are you trying to do? Is this password strength rules validation or just out and out...logging in?
|
|
|
|
|
We need more details..
With Regards
Rajeesh Menoth
|
|
|
|