|
You'll have trouble being able to tell the difference about where your page has come from in this instance. Not entirely sure what you mean by the page load...
|
|
|
|
|
Hi !
First of, you need the information from request header HTTP_Refferer, directly or wrapped in the Request object.
Here is the interesting discussion about it.
http://bytes.com/forum/thread646457.html[^]
Regards,
Gennady
|
|
|
|
|
Dear All & Gennady,
Thanks, I have read the discussion and it helps me to understand on the way of web application.
As a beginner, I just tried to understand more of ASP.Net.
Thanks,
Aung.
|
|
|
|
|
BTW, you may do it programmatically too.
Say, in the Page_Load of the first page you may set the session variable session("FirstPage") = 1
and in the Page_Load of the second page you may check this variable:
if (session("FirstPage")==1)<br />
{<br />
}<br />
else<br />
{<br />
}
This is in the case when you use Server.Transfer, that preserves session.
Response.Redirect - doesn't.
Regards,
Gennady
My English is permanently under construction. Be patient !!
modified on Tuesday, November 18, 2008 2:53 AM
|
|
|
|
|
Thanks Gennady,
Yes, I intend to apply this method in my project.
Thanks,
Aung.
|
|
|
|
|
I display a list of files on the screen, each with a checkbox next to it. At the bottom, there is a "Download" button that should allow the client users to download all the checked files to their computer. How can I do this bulk downloading (and having to ask the user to choose the location on their machine just once)?
I havent found any posts on the internet that shows this is possible. Many suggest zipping up all the selected files first on the server, and then download that ZIP file. But how do I zip up files on the fly (programmatically in C#/ASP.NET)? Is there a .NET class that supports all these zip operations??
thanks for any help!
Lakshmi
|
|
|
|
|
|
I am trying to run a simple web application and it does not run. Even view in browser does not work. The browser opens with the url ("http://localhost:3197/WebSite2/Default.aspx") and stays in a waiting state.
Can some one help me?
|
|
|
|
|
pranu_13 wrote: and stays in a waiting state.
looks like you have an infinite loop. Have you tried stepping into the code?
|
|
|
|
|
change you browser with "browse with" and try again, this problem may be exception on your browser.
Human knowledge belongs to the world
|
|
|
|
|
That did not work. i just added a button and label in the application. No other code. Interesting is when i replaced localhost with IP address it works. It does not work with localhost.
|
|
|
|
|
I have a table which name is login & contain 3 columns. Such as: Name,password & code. In code column contains the table name. eg: table1,table2 so on.
And I also create the table of same name as mentioned in code column which is mentioned above.
My requirement is that I insert the value in table1 or table2. but in insert query I want to put the table name from the code column.
I use following two methods but it didn’t work::
string code = " select code from login where user_name= name";
da = new SqlDataAdapter(code, con);
string s = da.Fill(ds, "c");
string time = " insert into '"+s+"' values (getdate(),getdate())";
da = new SqlDataAdapter(time, con);
da.Fill(ds, "b");
------------OR-------------
string code = " select code from login where user_name = name'";
string time = " insert into '"+code+"' values (getdate(),getdate())";
da = new SqlDataAdapter(time, con);
da.Fill(ds, "b");
thanks in advance
|
|
|
|
|
Your code is broken.
ahmad25 wrote: string s = da.Fill(ds, "c");
SqlDataAdapter.Fill is not returning string.
ahmad25 wrote: string time = " insert into '"+s+"' values (getdate(),getdate())";
You are not taking value from the filled dataset.
Try this
string code = "select code from login where user_name= name";
string s;
using(SqlCommand command = new SqlCommand(code,con)){
con.Open();
s = (string)command.ExecuteScalar();
con.Close();
}
string time = " insert into [" + s +"] values (getdate(),getdate())";
|
|
|
|
|
hii!
Thanks a lot to Mr. Navneeth. you r really solved my problem.
I have one more problem. In above program I fetch only one value from a column. if I want to fetch a entire row what can I do?
thanks again
|
|
|
|
|
ahmad25 wrote: I fetch only one value from a column. if I want to fetch a entire row what can I do?
ExecuteScalar can return only a single column. Use ExecuteReader instead. Take it to a SqlDataReader instance.
|
|
|
|
|
Hi,
If in login table you told that value is like table1,table2 etc. After retriving data from that column you directly inserted in insert query I don't think so you can insert data more that one table at a time. As per your code you are trying to write this query
insert into table1,table2 values ('1','1');
It will generate error. Am I right?
Other wise after retriving that data split it with , then loop and fire insert query.
Just reply am I write with above query. And also describe the error message perfactly.
http://techiefromsurat.blogspot.com
|
|
|
|
|
Hi!
Thanks for your reply. but i think you do not understand my question.
it is right that we can't insert data at a time more than one table.
Mr. Navneeth give me a right query.
Thanx
|
|
|
|
|
how to create more than one excel sheet on button click in asp.net and C#?
|
|
|
|
|
vikas2727 wrote: how to create more than one excel sheet on button click in asp.net and C#?
Probably in a loop
|
|
|
|
|
hi all, I am learning to send an email frm my website using system.net.mail. The mail is sent and there is no error but the recipient doesn't recieve the mail but it is shown in Inetpub\mailroot\queue and after sometime delivery is failed.
Plz help me.Where I am wrong ?? Any specific setting for this??
//variables
string strFromEmail = tbxFrom.Text;
string strToEmail = tbxTo.Text;
string strSubject = tbxSubject.Text;
string strMsg = ftbMsg.Text;
string strHostName = "mail.gmail.com";
int iHostSMTPPort=25;
//string strImagePath;
//variable to create message instace
MailAddress mailAddrFrom = new MailAddress(strFromEmail);
MailAddress mailAddrTo = new MailAddress(strToEmail);
MailMessage msgObj = new MailMessage(mailAddrFrom,mailAddrTo);
//definitions to send mail
SmtpClient smtpObj = new SmtpClient(strHostName, iHostSMTPPort);
//settings to send email
msgObj.Subject = strSubject;
msgObj.Body = strMsg;
msgObj.IsBodyHtml = true;
smtpObj.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
//sending email
smtpObj.Send(msgObj);
|
|
|
|
|
Does your SMTP server Configure properly?
|
|
|
|
|
I don't know. It works fine when I send email from my gmail account.but fails when I use any other domaim.I use server smtp.gmail.com
Thanks for ur response.
|
|
|
|
|
You can not use smtp.gmail.com you have to use mail.yourdomainname.com. and if you are sending from local system then use localhost or 127.0.0.1
I hope it will help you.
http://techiefromsurat.blogspot.com
|
|
|
|
|
joindotnet wrote: Inetpub\mailroot\queue
Your SMTP server might be stopped. Type inetmgr in the "Run" window, Click on "Default SMTP server" and start it.
|
|
|
|
|
It is not stopped.I have checked it.I can send emails from gmail to gmail if I use smtp.gmail.com host server.
How can I send mail from any domain to any domain.
Plz help.I'd be obliged.
|
|
|
|