|
I had posted this question couple of days ago but still not able to get the answer. I want to Get HTML by Executing URL on Server. I have got the HTML but problem is this Current Session Values are not being sent. I can't use query string I have to use current sessoin values!!! Any Help will be highly appricated!!!
|
|
|
|
|
Perhaps it would help if you were a little more specific about what you're doing... Are you normally able to read session values on different pages of the same application? If so, what is different about what you're doing in this case?
Fred
|
|
|
|
|
Thanks for ur reply!
Actually my code is!
Dim objWebClient As New WebClient<br />
Dim aRequestedHTML() As Byte<br />
aRequestedHTML = objWebClient.DownloadData(strURL)<br />
Dim objUTF8 As New UTF8Encoding<br />
Dim strRequestedHTML As String<br />
strRequestedHTML = objUTF8.GetString(aRequestedHTML)<br />
GETHTMLStream1 = strRequestedHTML
The request(URL) is sent to the server which returns the HTML. Now Problem is this request doesn't able to retrieve session values.
Session values are being reterieved on other pages.
|
|
|
|
|
Well no, it won't... Session values (SessionID anyway) are passed back and forth between the browser and the server whenever a page is requested - a form of cookie; this is how it knows which session values belong to which client - and just passing the URL to the server won't send the session values too. You'll need to re-think your model....
Fred
|
|
|
|
|
Do you have any suggestion regarding this!!!
|
|
|
|
|
Not really, I'm afraid.. if you really need to do it this way, I guess you'll have to pass the session variables as paramters of the url - if you're worried about security, you'll need to encrypt them first.
Either that, or go back to the drawing board and see if there isn't another way to achieve whatever it is you're trying to do...
Good luck - sorry I cna't be more help...
Fred
|
|
|
|
|
Hi All,
With this below code i am able to print the datagrid. The problem now is i am able to print only part of the data grid, that too first page as empty, second page with part of the content and third page again empty.. What might be the reason.. I am able to scroll through the datagrid .. How can i print the entire datagrid.. Please anyone help me..
here i am sending Datagrid object to strid..
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>
Thanks n Regards,
Umashanker.K
|
|
|
|
|
Are all your columns fitting on one page? You might get some weird printing truncating of columns if they don't fit on one page. Another question is if you have paging turned on. You would need to turn paging off so that all the rows show up.
Hope that helps.
Ben
|
|
|
|
|
Hi kubben, As u see my previous question my problem here is i am not able to print in continous order,even i am able to view the contends of the grid with scoll bar help..While printingand print preview the problem comes , how can i rectify. If i give window.print() for whole of the main page, not specifying the grid alone i am able to print the whole screen with other grid in the pages too.. plzz help a fessible solution for this.
Thanks & Regards
umashanker.k
|
|
|
|
|
You know it might be a good idea to see what sort of html doc you are creating.
Change your script to look like this:
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
prtContent.innerHTML=strOldOne;
}
</script>
So now the new window is larger and you can view the source to see what the html looks like.
I am guessing that the what you are writing to the page with you document.write isn't exaclt what you want.
Ben
|
|
|
|
|
Still the problem exists ben.. i even changed scrollbar setting too.. but then the same problem comes.. any suggestions
Rgrds
umashanker
|
|
|
|
|
If printing the whole page works. And printing part of the page does not work. Then issue is in the html. So you should be able to view the source of the full page and then view the source of the part of the page you are trying to print. You should be able to see the differences in the html which should help in why the part of the page isn't printing. without seeing the html it would be hard to say what is going on.
You may be missing some tags.
Ben
|
|
|
|
|
hello
How to implement remember me next time feature for login control in asp.net 2.0. if anyone knows plz give some idea.
bye
|
|
|
|
|
Login Control: builtin control for user autentication in it there is two textboxes(UserName and Password) and one CheckBox("Remember me next time") and a button(Login).
the Remember me next time check box is not working bydefault. i m doing that in my way below is the code for Working "Remember me next time" checkbox.
first we have to put login control on page like below
<asp:login id="Login1" runat="server" onloggedin="Login1_LoggedIN">
then do this code on Login1_LoggedIN Event like below
protected void Login1_LoggedIN(object sender, EventArgs e)
{
CheckBox rm = (CheckBox)Login1.FindControl("RememberMe");
if (rm.Checked)
{
HttpCookie myCookie = new HttpCookie("myCookie");
Response.Cookies.Remove("myCookie");
Response.Cookies.Add(myCookie);
myCookie.Values.Add("Email", this.Login1.UserName.ToString());
myCookie.Values.Add("Pass", this.Login1.Password.ToString());
DateTime dtExpiry = DateTime.Now.AddDays(15); //you can add years and months too here
Response.Cookies["myCookie"].Expires = dtExpiry;
}
}
and then do this code on Page_Load Event
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.Cookies["myCookie"] != null)
{
HttpCookie cookie = Request.Cookies.Get("myCookie");
string emailID = cookie.Values["Email"].ToString();
string password = cookie.Values["Pass"].ToString();
if (Membership.ValidateUser(emailID, password))
{
FormsAuthentication.RedirectFromLoginPage(emailID, true);
}
}
}
}
think its useful for u
i find this code from codeproject only......
bye
naresh.s.s
|
|
|
|
|
thanx for ur help. but i am confused that in this code where is the connectivity with database where we can check user name and pwd in database table. Which user name and pwd should be given to login for this code. When i give any user name and pwd it will give me error like "Your login attempt was not successful. Please try again."
Plz help me out for this.
bye
|
|
|
|
|
nareshss wrote: the Remember me next time check box is not working bydefault
It is?
only two letters away from being an asset
|
|
|
|
|
yes it is not working bydefault. what to make it working ? any code is there?
plz if you have idea then post it
|
|
|
|
|
hello,
How to store this user name and password in encrypted format in cookie?
bye
|
|
|
|
|
The Article by Britney S. Morales Here[^] will help you.
Regards,
Satips.
|
|
|
|
|
Hi All I m new to asp.net.
I want to create a page on which different images are displayed. It will work like remote control. There will b a main Image. And in the lower part of the page there will be other images. I want to swap the main image with the other one when some one click on image in the lower part. Please give me any link, where I can start.
|
|
|
|
|
Maybe something like the below?
Fred
<html>
<head>
<script language="javascript">
<!--
function swapImage(i) {
mainPic.src = i.src;
}
// -->
</script>
</head>
<body>
<img id="mainPic" src="default.jpg">
<br><br>
<img src="image1.jpg" width="100" height="100" onclick="swapImage(this);">
<img src="image2.jpg" width="100" height="100" onclick="swapImage(this);">
<img src="image3.jpg" width="100" height="100" onclick="swapImage(this);">
</body></html>
|
|
|
|
|
Thank u dear,
It realy help me.
|
|
|
|
|
i have created a web application in c# and ASP.NET1.1 that is having a button on click of which
spawns a web page which is hosted on my localhost!
i have given the URL to my friend.Now he/she access it .
I want a alert box or some notification on my local computer that the webpage from my localhost
is being accessed.
Is it possible with .NET 1.1 ?
If yes, how?
Thanks in advance
|
|
|
|
|
I dont know how you get an alert window if some one browsing your url from his/her PC. but try the following, you just copy and paste the following into your web.config file.
<trace enabled="true" requestlimit="10" pageoutput="false" tracemode="SortByTime">save the file. then ask your friend to browse the URL which you given. after that, your browse the URL like: http://localhost/yourapp?trace.axd
Karthik
|
|
|
|
|
now where i get the traced thing?
i m not getting anything .
Can u please u explain in a bit detail?
Thanks
|
|
|
|