QueryString parameter OnAfterLogin PEI
Hi,
I am a beginner in ALUI portal development and writing c# program in OnAfterLogin PEI to capture the querystring paramater from the URL. But I am not able to capture the querystring parameter from the URL. suppose This is the URL I am entering in the browser.
http:techarena.in/portal/server?TokenID=j5S1Apz3
This is the code I wrote in OnAfterLogin PEI.
IXPRequest xpRequest = _appData.GetRequest();
string redirectAfterLogin=xpRequest.GetRequestURL();
pTokenID=xpRequest.GetParameterValue("TokenID");
But the QueryString is always null. Please help me to figure it out.
Thanks in advance.
Re: QueryString parameter OnAfterLogin PEI.
try doing something like this:
_appData.GetRequest().GetParameterValue(TokenID)
It may help you
Re: QueryString parameter OnAfterLogin PEI.
No it didn't work. although The above code work for a guest login. I can capture the Queystring for the GuestUser. But when we enter the user ID and Password in the login page, the querystring is always null on onAfterLogin.
Re: QueryString parameter OnAfterLogin PEI.
So this is a line directly from one of my pei's:
_appData.GetParameterValue("curRef");
Now that said, it is from a PEI that gets invoked by a guest user. I have never tried to grab a qs from a newly logged in user, but it should be the same. What i suggest is that you debug and step through your pei. You should take a look at the request object and the appdata object to see what is exactly in there. Perhaps the QS is getting stripped or something during aredirect.
Re: QueryString parameter OnAfterLogin PEI.
Try GetQueryString()
gets all data after the /portal/server.pt
It could be getting stripped, especially if as guest user you had to physically press the "login" button that redirected you to the login page.
If not, it should still be there.
Re: QueryString parameter OnAfterLogin PEI.
Figured it out. The string redirectAfterLoginURL contails all the URL parameters, it is working if the url contains some community ID.
IXPRequest xpRequest = _appData.GetRequest();
string redirectAfterLoginURL = Request.GetParameterValue(ASConstants.REDIRECT_AFTER_LOGIN_INPUT);
Thanks guys for your help.