ラベル pages の投稿を表示しています。 すべての投稿を表示
ラベル pages の投稿を表示しています。 すべての投稿を表示

2012年3月28日水曜日

Response.redirect - display text in same page.

Hi guys,

I am using A.aspx , B.aspx and C.aspx pages.

From A.aspx I am calling b.aspx via Ajax code. After (Check Login user from database) success status , I am tryint o redirecting to C.aspx. But

C. aspx page content is dispalying in A.aspx. It suppose to be redirec to C.aspx. What I am dong wrong here..??

any suggessions ??

hello.

well, i'mo not following you. can you be more specific?


I am trying to check the Loginuser permissions from the Database. Once he get success permission the page has to redirect to new page.
here is my Code.

Login.aspx (a.aspx) - Enter user id & pwd and click Submit then below code executes


function CheckUser()
{
if (preLoginCheck())
{ var url = serverName+"checkLogUser.aspx?userID="+ document.frmDefault.txtUid.value +"&Pwd="+ document.frmDefault.txtPwd.value;
xmlHttp = GetXmlHttpObject(ChangeHandler);
xmlHttp_Get(xmlHttp, url);
}
}


function ChangeHandler()
{ if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete')
{ var getData=xmlHttp.responseText;
if (getData=="Success")
{ document.getElementById("ErrorCode").innerText=" GoooooooooooooooD";
}
else
{
document.getElementById("ErrorCode").innerText=getData; //" Invalid User name /Password";
}
}
}

checkLogUser.aspx (b.aspx) - Ajax will execute this page from here itself I want to redirec to Third Page..


If (tmpUserID <> "" And tmpUserPwd <> "") Then
crapObj = New CRAPManagement
getLogInStatus = crapObj.checkLoginUserAccess(tmpUserID, tmpUserPwd)
If getLogInStatus = "Success" Then
Response.Redirect("UserCreate.aspx") --> C.Aspx
Else
Response.Write(getLogInStatus)
End If
End If

Finanl result is C.Aspx page content is displaed in Login.aspx Page.


hello.

well, if you're using asp.net 2.0, then check the authenticationservice class:

http://www.asp.net/ajax/documentation/live/ClientReference/Sys.Services/AuthenticationServiceClass/default.aspx


Hello,
I could't understand wha should I do exactly...!


hello.

well, instead of writing your own code for making the remote call and then having to build your page on the server that has server logic for authenticating a user, you'll get that for free with the service i've showed you in the previous post (it'll authenticate by using forms authentication and it'll automatically use the current defined membership provider you've set up on the server side).

2012年3月24日土曜日

Returning a Form for Master Detail pages.

So I am trying to do something in .NET with AJAX that I do rather easily in jsp. It seems like such a common thing, I can only assume that I am just not googling the right terms, and any help would be apreciated. Here's the scenario:
Standard master detail says show a list of items, click one, be taken to a form to edit the item. What I'm looking for is the click on the link just populates the form for the proper item, which is rendered either below or to the right of the list. User edits the item, clicks a button on the form, the form is submitted (also just that region submitted, not the whole page), and a message for success or failure is shown.
I am able to do this with ease in jsp with several frameworks but am now working in the .NET arena and am having no end of trouble. I get as far as:
display the list
onclick call and ajax function (currently using AJAX.NET)
proper method gets called
I render a custom user control (contains a form) into an htmlTextWriter backed by a TextWriter backed by a StringBuilder, and I return that string to replace the content of a div on the page.
Several problems:
Why the need to jump through hoops with the various writers? Is there an easier way to just render a page snippet/custom control into the response stream?
Is there or will there be a facility to return server generated controls/control hierarchies from the server with Atlas?
What am I missing here? Any help would be greatly appreciated.
Thanks

You may want to try the refresh panel library:http://www.gotdotnet.com/Workspaces/Workspace.aspx?id=cb2543cb-12ec-4ea1-883f-757ff2de19e8
Or wait for Atlas to implement similar features.
Thanks for the link - I'll check it out.