|
Send your mail in HTML format and put it in an anchor tag, just like you would on a web page.
|
|
|
|
|
Dear All,
I am new to ASP.Net.
In windows application, a particular form can be called by a previous form. (eg. form2 is called from form1 - the entry point to form2 is from form1 only.)
In web application, my understanding is that form2 can be called from brower address bar by typing the address of form2.
How it can be done as in windows application.
Please forgive me, if it is a wrong site for the question.
Thanks,
Aung.
|
|
|
|
|
From one page to another, you want to use Response.Redirect, or Server.Transfer. There isn't the same concept of individual pages really being aware of each other, as in a windows application though.
|
|
|
|
|
You must use
Response.Redirect("Name of second page")
or
Server.Transfer("Name of second page")
both will do the same thing i-e from form1 moves u to form2
to read more about this Google it.
|
|
|
|
|
Thanks for the answers.
I would like to know is that
- if it is called directly from browser address bar, show an error message and redirect to previous page.
- if it is to be done at page load event, it is a correct practice.
Thanks
Aung.
|
|
|
|
|
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);
|
|
|
|