|
hi,
I am trying to use ajax tab panels to gather information from a user. I have controls in the first tab which I would like to vaildate before moving to the second tab. Is there a way I can force the user to stay in the 1st tab if they havent satisied the validation? how to stop the user from moving to the next tab?
regards,
Bill
|
|
|
|
|
Hi, I think you must set the properties of your tab panel to autopostback=true
and then in your tabpanel
If tabs.ActiveTabIndex = 1 Then
textbox1.Text = "sayre"
End If
Hope this one can help.
Thanks
|
|
|
|
|
Hi i am trying to import contacts from AOL and hotmail
i have done it in Gmail and yahoo but not able to do for Hotmail and AOL
will anybody send me some help.
Thanks & Regards,
Prashant B. Lavate
Software Engineer
Mobile : +919423872257
Pune(India)
|
|
|
|
|
What kind of problem are you facing when you try it for hotmail or AOL? Do you get some kind of error?
|
|
|
|
|
in hotmil it is not giving location so null is coming
Thanks & Regards,
Prashant B. Lavate
Software Engineer
Mobile : +919423872257
Pune(India)
|
|
|
|
|
Okay??? so could you post a bit of the code and point to the line where the error occurs?
|
|
|
|
|
public void GetContacts(string strUserName, string strPassword, out bool boolIsOK, out DataTable dtContatct, out string strError)
{
//default values
dtContatct = new DataTable();
boolIsOK = true;
strError = string.Empty;
// ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(MyCertValidation);
//1=================================================================================================================
//http://mail.live.com the AllowAutoRedirect will call the next url subsequently
//http://login.live.com/login.srf?wa=wsignin1.0&rpsnv=10&ct=1193552878&rver=4.5.2130.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&id=64855
String strRequestUrl = "http://mail.live.com";
HttpWebRequest webReqFirstPage = (HttpWebRequest)WebRequest.Create(strRequestUrl);
webReqFirstPage.Method = Utility.Get;
webReqFirstPage.KeepAlive = true;
webReqFirstPage.AllowAutoRedirect = true;
webReqFirstPage.CookieContainer = new CookieContainer();
webReqFirstPage.UseDefaultCredentials = true;
webReqFirstPage.UserAgent = Utility.UserAgent;
HttpWebResponse webResFirstPage = (HttpWebResponse)webReqFirstPage.GetResponse();
CookieCollection ccWebReqFirstPage = new CookieCollection();
if (webResFirstPage.Headers[Utility.SetCookie] != null)
{
ccWebReqFirstPage = Utility.GetAllCookiesFromHeader(webResFirstPage.Headers[Utility.SetCookie], webResFirstPage.ResponseUri.Host);
}
StreamReader sr1 = new StreamReader(webResFirstPage.GetResponseStream());
String strFirstPage = sr1.ReadToEnd();
sr1.Close();
webResFirstPage.Close();
webReqFirstPage.Abort();
//this is the url for 3rd request
string strLoginUrlTemp = Utility.GetRegExParsedValue("srf_uPost='(?<retval>.*?)'", strFirstPage); //For 3rd Request
//keeping values from the FORM for 3rd request
string strPPSXValue = Utility.GetRegExParsedValue("srf_sRBlob='(?<retval>.*?)'", strFirstPage);
string strPPFTValue = Utility.GetRegExParsedValue("<input.*?name>.*?)\"/>", strFirstPage);
//this page call the 2nd request through javascrpt..for this collecting the url
string strBaseUrl = Utility.GetRegExParsedValue("<base\\s*href>.*?)\"\\s*/>", strFirstPage); ;
string strPageUrl = Utility.GetRegExParsedValue("<script.*?src>.*?)\">", strFirstPage); ;
string strFullUrl = strBaseUrl + strPageUrl;//For 2nd request
//2=================================================================================================================
//http://login.live.com/pp500/WLLogin_JS.srf?x=5.0.7495.0&lc=1033
string strRequestUrlJSCall = strFullUrl;
HttpWebRequest webReqJSCall = (HttpWebRequest)WebRequest.Create(strRequestUrlJSCall);
webReqJSCall.Method = Utility.Get;
webReqJSCall.KeepAlive = true;
webReqJSCall.AllowAutoRedirect = false;
webReqJSCall.UseDefaultCredentials = true;
webReqJSCall.UserAgent = Utility.UserAgent;
webReqJSCall.Referer = webResFirstPage.ResponseUri.ToString();
webReqJSCall.CookieContainer = new CookieContainer();
webReqJSCall.CookieContainer.Add(ccWebReqFirstPage);
HttpWebResponse webResJSCall = (HttpWebResponse)webReqJSCall.GetResponse();
StreamReader sr1JSCall = new StreamReader(webResJSCall.GetResponseStream());
string strJSCall = sr1JSCall.ReadToEnd();
sr1JSCall.Close();
webResJSCall.Close();
webReqJSCall.Abort();
//this cookie created through javascript
Cookie cookCkTst = new Cookie("CkTst", Utility.GetJavaScriptTime(), "/", ".live.com");
ccWebReqFirstPage.Add(cookCkTst);
//keeping values from the FORM for 3rd request
string strPwdPad = Utility.GetRegExParsedValue("sPad=\"(?<retval>.*?)\"", strJSCall); // i have time man
string stridsbho = Utility.GetRegExParsedValue("\"idsbho\",\".*?\",\"(?<retval>.*?)\"", strJSCall);
//3=================================================================================================================
//https://login.live.com/ppsecure/post.srf?wa=wsignin1.0&rpsnv=10&ct=1193552878&rver=4.5.2130.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&id=64855&bk=1193552881
string strLoginUrl = strLoginUrlTemp;
string strLoginBody = "idsbho=" + stridsbho + "&PwdPad=" + strPwdPad + "&LoginOptions=2&CS=&FedState=&PPSX=" + strPPSXValue + "&type=11&login=" + strUserName + "&passwd=" + strPassword + "&remMe=1&NewUser=1&PPFT=" + strPPFTValue + "&i1=0&i2=2";
HttpWebRequest webReqLogin = (HttpWebRequest)WebRequest.Create(strLoginUrl);
webReqLogin.Method = Utility.Post;
webReqLogin.UserAgent = Utility.UserAgent;
webReqLogin.KeepAlive = true;
webReqLogin.ContentType = Utility.ContentTypeUrlEncoded;
webReqLogin.UseDefaultCredentials = true;
webReqLogin.Referer = webResFirstPage.ResponseUri.ToString(); ;
webReqLogin.CookieContainer = new CookieContainer();
webReqLogin.CookieContainer.Add(ccWebReqFirstPage);
webReqLogin.ContentLength = strLoginBody.Length;
StreamWriter sw = new StreamWriter(webReqLogin.GetRequestStream());
sw.Write(strLoginBody);
sw.Close();
HttpWebResponse webResLogin = (HttpWebResponse)webReqLogin.GetResponse();
CookieCollection ccWebResLogin = new CookieCollection();
if (webResLogin.Headers[Utility.SetCookie] != null)
{
ccWebResLogin = Utility.GetAllCookiesFromHeader(webResLogin.Headers[Utility.SetCookie], webResLogin.ResponseUri.Host);
}
string strNewResponseUrl = webResLogin.ResponseUri.ToString();
StreamReader sr = new StreamReader(webResLogin.GetResponseStream());
string strMainPage = sr.ReadToEnd();
sr.Close();
webResLogin.Close();
webReqLogin.Abort();
//Get the next url for 4 th request
string strMailLiveComUrlTemp = Utility.GetRegExParsedValue("replace\\(\"(?<retval>.*?)\"\\)", strMainPage);
if (strMailLiveComUrlTemp == string.Empty)
{
boolIsOK = false;
strError = Utility.UseridPassWrong;
return;
}
//4=================================================================================================================
//http://mail.live.com/default.aspx?wa=wsignin1.0..only for UI cookie
string strMailLiveComUrl = strMailLiveComUrlTemp;
HttpWebRequest webReqMailLiveComASPX = (HttpWebRequest)WebRequest.Create(strMailLiveComUrl);
webReqMailLiveComASPX.Method = Utility.Get;
webReqMailLiveComASPX.Accept = Utility.AcceptAll;
webReqMailLiveComASPX.UserAgent = Utility.UserAgent;
webReqMailLiveComASPX.KeepAlive = true;
webReqMailLiveComASPX.AllowAutoRedirect = false;
webReqMailLiveComASPX.UseDefaultCredentials = true;
webReqMailLiveComASPX.CookieContainer = new CookieContainer();
webReqMailLiveComASPX.CookieContainer.Add(ccWebResLogin);
HttpWebResponse webResMailLiveComASPX = (HttpWebResponse)webReqMailLiveComASPX.GetResponse();
CookieCollection ccWebResMailLiveComASPX = new CookieCollection();
if (webResMailLiveComASPX.Headers[Utility.SetCookie] != null)
{
ccWebResMailLiveComASPX = Utility.GetAllCookiesFromHeader(webResMailLiveComASPX.Headers[Utility.SetCookie], webResMailLiveComASPX.ResponseUri.Host);
}
StreamReader srMailLiveCom = new StreamReader(webResMailLiveComASPX.GetResponseStream());
string strMailLiveComPage = srMailLiveCom.ReadToEnd();
srMailLiveCom.Close();
webResMailLiveComASPX.Close();
webReqMailLiveComASPX.Abort();
//start---keeping values for next request..first half looks:"http://by112w.bay112.mail.live.com/mail/
string strNextUrlTemp = webResMailLiveComASPX.Headers[Utility.Location].ToString();
//string strNextUrlTemp = Utility.GetRegExParsedValue("replace\\(\"(?<retval>.*?)\"\\)", strMainPage);
string strFirstHalfUrlTemp = Utility.GetRegExParsedValue(@"(?<retval>.*?mail/)", strNextUrlTemp);
if (strNextUrlTemp == string.Empty)
{
boolIsOK = false;
strError = Utility.ApplicationError;
return;
}
//5=================================================================================================================
//http://by112w.bay112.mail.live.com/mail/TodayLight.aspx?wa=wsignin1.0&n=1317674709&gs=true
string strByBayUrl = strNextUrlTemp;
HttpWebRequest webReqByBayASPX = (HttpWebRequest)WebRequest.Create(strByBayUrl);
webReqByBayASPX.Method = Utility.Get;
webReqByBayASPX.UserAgent = Utility.UserAgent;
webReqByBayASPX.KeepAlive = true;
webReqByBayASPX.AllowAutoRedirect = false;
webReqByBayASPX.UseDefaultCredentials = true;
webReqByBayASPX.CookieContainer = new CookieContainer();
webReqByBayASPX.CookieContainer.Add(ccWebResLogin);
webReqByBayASPX.CookieContainer.Add(ccWebResMailLiveComASPX);
HttpWebResponse webResByBayASPX = (HttpWebResponse)webReqByBayASPX.GetResponse();
CookieCollection ccWebResByBayASPX = new CookieCollection();
if (webResByBayASPX.Headers[Utility.SetCookie] != null)
{
ccWebResByBayASPX = Utility.GetAllCookiesFromHeader(webResByBayASPX.Headers[Utility.SetCookie], webResByBayASPX.ResponseUri.Host);
}
StreamReader srByBay = new StreamReader(webResByBayASPX.GetResponseStream());
string strByBayPage = srByBay.ReadToEnd();
srByBay.Close();
webResByBayASPX.Close();
webReqByBayASPX.Abort();
//keep options page url for next request... if it is CLASSIC version
string strOptionsPageUrlTemp = Utility.GetRegExParsedValue(@"<a.*?href>.*?)"".*?id=""Options"".*?>", strByBayPage);
if (strOptionsPageUrlTemp == string.Empty) //If it is FULL version
{
strOptionsPageUrlTemp = "options.aspx?subsection=1&n=" + Utility.GetJavaScriptTime();
}
string strOptionsPageUrl = strFirstHalfUrlTemp + strOptionsPageUrlTemp;
if (strOptionsPageUrlTemp == string.Empty)
{
boolIsOK = false;
strError = Utility.ApplicationError;
return;
}
//6=================================================================================================================
//http://by112w.bay112.mail.live.com/mail/options.aspx?subsection=1&n=506906558
string strOptionsUrl = strOptionsPageUrl;
HttpWebRequest webReqOptionsASPX = (HttpWebRequest)WebRequest.Create(strOptionsUrl);
webReqOptionsASPX.Method = Utility.Get;
webReqOptionsASPX.UserAgent = Utility.UserAgent;
webReqOptionsASPX.KeepAlive = true;
webReqOptionsASPX.AllowAutoRedirect = false;
webReqOptionsASPX.Referer = strByBayUrl;
webReqOptionsASPX.UseDefaultCredentials = true;
webReqOptionsASPX.CookieContainer = new CookieContainer();
webReqOptionsASPX.CookieContainer.Add(ccWebResLogin);
webReqOptionsASPX.CookieContainer.Add(ccWebResMailLiveComASPX);
webReqOptionsASPX.CookieContainer.Add(ccWebResByBayASPX);
HttpWebResponse webResOptionsASPX = (HttpWebResponse)webReqOptionsASPX.GetResponse();
CookieCollection ccwebResOptionsASPX = new CookieCollection();
if (webResOptionsASPX.Headers[Utility.SetCookie] != null)
{
ccwebResOptionsASPX = Utility.GetAllCookiesFromHeader(webResOptionsASPX.Headers[Utility.SetCookie], webResOptionsASPX.ResponseUri.Host);
}
StreamReader srOptions = new StreamReader(webResOptionsASPX.GetResponseStream());
string strOptionsPage = srOptions.ReadToEnd();
srOptions.Close();
webResOptionsASPX.Close();
webReqOptionsASPX.Abort();
//keeping export page url for next request
string strExportPageUrlTemp = Utility.GetRegExParsedValue(@"<a\s*href>.*?)"".*?>\s*Export.*?contacts", strOptionsPage);
string strExportPageUrl = strFirstHalfUrlTemp + strExportPageUrlTemp;
if (strExportPageUrlTemp == string.Empty)
{
boolIsOK = false;
strError = Utility.ApplicationError;
return;
}
//7=================================================================================================================
//http://by112w.bay112.mail.live.com/mail/options.aspx?subsection=26&n=1234655194
string strExpContactsUrl = strExportPageUrl;
HttpWebRequest webReqExpContactsASPX = (HttpWebRequest)WebRequest.Create(strExpContactsUrl);
webReqExpContactsASPX.Method = Utility.Get;
webReqExpContactsASPX.UserAgent = Utility.UserAgent;
webReqExpContactsASPX.KeepAlive = true;
webReqExpContactsASPX.AllowAutoRedirect = false;
webReqExpContactsASPX.ContentType = Utility.ContentTypeTextHtml;
webReqExpContactsASPX.UseDefaultCredentials = true;
webReqExpContactsASPX.CookieContainer = new CookieContainer();
webReqExpContactsASPX.CookieContainer.Add(ccWebResLogin);
webReqExpContactsASPX.CookieContainer.Add(ccWebResMailLiveComASPX);
webReqExpContactsASPX.CookieContainer.Add(ccWebResByBayASPX);
HttpWebResponse webResExpContactsASPX = (HttpWebResponse)webReqExpContactsASPX.GetResponse();
CookieCollection ccWebResExpContactsASPX = new CookieCollection();
if (webResExpContactsASPX.Headers[Utility.SetCookie] != null)
{
ccWebResExpContactsASPX = Utility.GetAllCookiesFromHeader(webResExpContactsASPX.Headers[Utility.SetCookie], webResExpContactsASPX.ResponseUri.Host);
}
StreamReader srExpContacts = new StreamReader(webResExpContactsASPX.GetResponseStream());
string strExpContactsPage = srExpContacts.ReadToEnd();
srExpContacts.Close();
webResExpContactsASPX.Close();
webReqExpContactsASPX.Abort();
//keeping export page url for next request
string strContactsCSVTemp = Utility.GetRegExParsedValue(@"<form.*?name>.*?)"".*?>", strExpContactsPage);
string strContactsCSV = strFirstHalfUrlTemp + strContactsCSVTemp;
//start collect BODY values for next request
//getting value for postback: __VIEWSTATE
string strVIEWSTATE = Utility.GetRegExParsedValue(@"<input.*?name>.*?)"".*?/>", strExpContactsPage);
//getting value for postback: __EVENTVALIDATION
string strEVENTVALIDATION = Utility.GetRegExParsedValue(@"<input.*?name>.*?)"".*?/>", strExpContactsPage);
//getting value for postback: mt //Utility.GetRegExParsedValue(@"<input.*?name>.*?)"".*?/>", strExpContactsPage);
string strmt = ccWebResByBayASPX["mt"].Value;
//getting value for postback: ctl01$ExportButton
string strExportButton = Utility.GetRegExParsedValue("<input.*?name>.*?)\".*?value=\"Export contacts\".*?/>", strExpContactsPage) + "=" + "Export contacts";
if (strContactsCSVTemp == "" || strVIEWSTATE == "" || strEVENTVALIDATION == "" || strmt == "" || strExportButton == "")
{
boolIsOK = false;
strError = Utility.ApplicationError;
return;
}
strVIEWSTATE = "__VIEWSTATE=" + strVIEWSTATE;
strEVENTVALIDATION = "__EVENTVALIDATION=" + strEVENTVALIDATION;
strmt = "mt=" + strmt;
//8=================================================================================================================
//http://by112w.bay112.mail.live.com/mail/options.aspx?subsection=26&n=938064379
string strCSVUrl = strContactsCSV;
HttpWebRequest webReqCSVASPX = (HttpWebRequest)WebRequest.Create(strCSVUrl);
string strCSVBody = strVIEWSTATE + "&" + strmt + "&" + strExportButton + "&" + strEVENTVALIDATION;
webReqCSVASPX.Method = Utility.Post;
webReqCSVASPX.UserAgent = Utility.UserAgent;
webReqCSVASPX.KeepAlive = true;
webReqCSVASPX.Referer = strExpContactsUrl;
webReqCSVASPX.AllowAutoRedirect = true;
webReqCSVASPX.ContentType = Utility.ContentTypeUrlEncoded;
webReqCSVASPX.UseDefaultCredentials = true;
webReqCSVASPX.CookieContainer = new CookieContainer();
webReqCSVASPX.CookieContainer.Add(ccWebResLogin);
webReqCSVASPX.CookieContainer.Add(ccWebResMailLiveComASPX);
webReqCSVASPX.CookieContainer.Add(ccWebResByBayASPX);
StreamWriter sw4 = new StreamWriter(webReqCSVASPX.GetRequestStream());
sw4.Write(strCSVBody); sw4.Close();
HttpWebResponse webResCSVASPX = (HttpWebResponse)webReqCSVASPX.GetResponse();
CookieCollection ccWebResCSVASPX = new CookieCollection();
if (webResCSVASPX.Headers[Utility.SetCookie] != null)
{
ccWebResCSVASPX = Utility.GetAllCookiesFromHeader(webResCSVASPX.Headers[Utility.SetCookie], webResCSVASPX.ResponseUri.Host);
}
webResCSVASPX.Cookies = webReqCSVASPX.CookieContainer.GetCookies(webReqCSVASPX.RequestUri);
StreamReader srCSV = new StreamReader(webResCSVASPX.GetResponseStream());
string strCSVPage = srCSV.ReadToEnd();
srCSV.Close();
webResCSVASPX.Close();
webReqCSVASPX.Abort();
if (strCSVPage == string.Empty)
{
boolIsOK = false;
strError = Utility.ApplicationError;
return;
}
//=================================================================================================================
boolIsOK = true;
dtContatct = Utility.ConvertCSVIntoDataTable(strCSVPage);
strError = string.Empty;
}
Thanks & Regards,
Prashant B. Lavate
Software Engineer
Mobile : +919423872257
Pune(India)
|
|
|
|
|
And the line where the error occurs?
|
|
|
|
|
string strNextUrlTemp = webResMailLiveComASPX.Headers[Utility.Location].ToString();
it is giving null
Thanks & Regards,
Prashant B. Lavate
Software Engineer
Mobile : +919423872257
Pune(India)
|
|
|
|
|
Okay, and what is Utility.Location (the string)? Is it important, or can you just ignore it for AOL and Hotmail? Maybe these both don't provide the value?
|
|
|
|
|
yes this is imp coz it g
takes url after login to hotmail
Thanks & Regards,
Prashant B. Lavate
Software Engineer
Mobile : +919423872257
Pune(India)
|
|
|
|
|
So I would check what you are getting back after login. I suggest using a tcpmonitor to capture everything that will run through the wire while you login at AOL or Hotmail. Maybe it is another property you have to look for.
You can find a good tcp monitor here: https://tcpmon.dev.java.net/[^]
modified on Thursday, April 23, 2009 6:15 AM
|
|
|
|
|
yes it's a feature and thanks for your article.........
|
|
|
|
|
The location is a feature?
Which article?
|
|
|
|
|
i am using
i frame with src="http://www.yahoo.com" first time it opens yahoo site correctly inside iframe but when i click on any link in it..next page of yahoo opens in full screen instead of iframe how to solve this problem???
Government Dyal Singh College Lahore.
|
|
|
|
|
Hi, I think you must input your iframe in a masterpage or frameset.
try to input your iframe inside your frameset or masterpage.
Thanks
|
|
|
|
|
Specify
<base target="_self" /> in header section of your page where IFrame resides.
Regards,
Nyoti
|
|
|
|
|
Hi, When i run my asp.net2.0 application i get the bug message :
"A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
An exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll but was not handled in user code"
. What could it be , Plz Help!!
|
|
|
|
|
Are you redirecting from a page before the processing completes? Show us the relevant code.
|
|
|
|
|
|
Hey,
That usually occurs when using Response.Redirect("url"). Find the place where you do this and use Response.Redirect("url", false);
By default response.redirect will end the response thread and when you specify false you instruct it not to. I don't really know why you would want that.
Regards
|
|
|
|
|
Hi all,
I want to take the values from database and keep in href in Grid and in database i will store the link path and title for the hyperlink path
For example -(Click)
I will get the values default.aspx and click from the database
and i want to keep in Infragistics grid as href
I got the values from the database as Dataset ..
How to set the href path and title for the hyperlink column in Ingragistics grid ..
Pl s can any one suggest me the solution
|
|
|
|
|
Hi, try this code
<asp:gridview id="grdIDCODE" runat="server" autogeneratecolumns="false">
<columns>
<asp:templatefield headertext="IDCode">
<itemtemplate>
<asp:hyperlink id="lnkID" runat="server" text='<# Eval("[ColumnField]") &>'OnDataBinding="lnkIDCode_DataBinding">
</asp:hyperlink>
</itemtemplate>
</asp:templatefield>
</columns>
</asp:gridview>
Hope this one can help.
Thanks
|
|
|
|
|
Hi Thank u for your help..
i cant undstand code 'OnDataBinding="lnkIDCode_DataBinding">
I want to give the navigateurl and text from the database
can i give like this??
asp:hyperlink id="lnkID" runat="server"text='<# Eval("[ColumnField]") &>´ navigateurl='<# Eval("[ColumnField1]") &>
|
|
|
|
|
How to use garbage colloection when using crystal report. because every after one day ot two crystal reports stops displaying and starts throwing errors.
Ashish Jha
Software Engineer
|
|
|
|