I might be wrong here, but I think you would be better off with populating the member property values into regular HTML inputs and then look for the if(!IsPost). Something like this:
@{ if(!IsPost) { // populate values of current member to regular HTML form, i.e. <form method="post" action="/this-page.aspx"> <label for="firstname">Firstname:</label> <input type="text" name="firstname" id="firstname" value='@member.getProperty("firstname").Value' /> </form> } else { // grab values from the post request, i.e. var name = Request["firstname"]; } }
Above snippet is not tested :-) but it should give you an idea of what I mean.
Is there, by the way, any of your controls that contains prevalues? I.e. a dropdown list, checkbox list etc.
Using dataeditor control into razor
hi all,
i'm writing a memeber's info edit form, i'm looping the propertyes of membertype beacuse there's different membertypes.
i have found this method :
that return a ast.net control, can i use it into razor script?
or there is another way to get the editor control?
Hi Giuseppe,
I might be wrong here, but I think you would be better off with populating the member property values into regular HTML inputs and then look for the if(!IsPost). Something like this:
Above snippet is not tested :-) but it should give you an idea of what I mean.
Is there, by the way, any of your controls that contains prevalues? I.e. a dropdown list, checkbox list etc.
/ Bo
"Is there, by the way, any of your controls that contains prevalues? I.e. a dropdown list, checkbox list etc."
yes there is.
what are you wrote is the same that I use now
I hope into some kind of facilities that make well formatted output, without write all the html and js,
and a way to iterate all the propertyes making the correnct input control without know the name and the type.
this because other people maybe (certainly) change the propertyes of member type
thanks
is working on a reply...