Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Update using ajax in asp.net mvc -


hi can tell me problem please, , how fix it.

i'm trying update part of page using ajax, i'm using basic code comes new mvc project.

the logon page has this:

 <span id="error"/> @using (ajax.beginform("logon", "account", new ajaxoptions { updatetargetid="error"})) {     <div>         <fieldset>             <legend>account information</legend>              <div class="editor-label">                 @html.labelfor(m => m.username)             </div>             <div class="editor-field">                 @html.textboxfor(m => m.username)                 @html.validationmessagefor(m => m.username)             </div>              <div class="editor-label">                 @html.labelfor(m => m.password)             </div>             <div class="editor-field">                 @html.passwordfor(m => m.password)                 @html.validationmessagefor(m => m.password)             </div>              <div class="editor-label">                 @html.checkboxfor(m => m.rememberme)                 @html.labelfor(m => m.rememberme)             </div>              <p>                     <input type="submit" value="log on" />             </p>         </fieldset>     </div> } 

and controller so:

        [httppost]         public string logon(logonmodel model, string returnurl)         {              if (modelstate.isvalid)             {                 if (membershipservice.validateuser(model.username, model.password))                 {                     formsservice.signin(model.username, model.rememberme);                     if (url.islocalurl(returnurl))                     {                          redirect(returnurl);                     }                     else                     {                          redirecttoaction("index", "home");                     }                 }                 else                 {                     modelstate.addmodelerror("", "the user name or password provided incorrect.");                 }             }              return "the user name or password provided incorrect.";         } 

basically have done embeded login form modal popup. if entered user credentials fail want error displayed inside modal popup, not go off page.

the above code creating blank page text "the user name or password provided incorrect."...i need displayed in modal dialog (jquery).

well, obvious question is, have scripts added page you're trying in? second, if you're posting https (you are, right?), scripts have https or you'll security error.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -