|
That first link is exactly what I was looking for.
Thank you ever so much for saving me bunches of time!
,Gary
|
|
|
|
|
I am using the onClick event to send an email using System.Net.Mail.
It works great. If I add a 'PostBackURL' to the asp button on my form to point to a confirmation page, that works but it breaks the sending of my email.
Is there a way, within my C# code behind, that I can send the user to the confirmation page after the mail sending?
|
|
|
|
|
use response.redirect to send the user to confirmation page after sending email
-----
|
|
|
|
|
Thanks again !!
SABhatti... do you live here(Code Project forums)?
LOL
|
|
|
|
|
nope I live in NY
-----
|
|
|
|
|
I was entering a blog entry in one of our company's web apps, and I got this error when I submitted the post:
A potentially dangerous Request.Form value was detected from the client (_ctl0:cph_Main:_ctl0:_ctl0:postBackBody="...refighter.<br/>
<br/>
Well, ...").
Has anyone every seen anything like this before?
-- modified at 10:28 Monday 26th November, 2007
I deleted the text I thought was creating the problem, because it doesn't seem to matter what I put in there.
-- modified at 10:29 Monday 26th November, 2007
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Has anyone every seen anything like this before?
Yeah. If the user entry the HTML tag in your page, you will get this error..
You can read No.6 as below from my post Some FAQ from ASP.NET web development.
6. Protecting an ASP.NET page against malicious input with ValidateRequest (A potentially dangerous Request.Form value was detected)
When your project is in testing state, you should try to test your application by entering script tag (eg: <script lanague=”javascript”>) or HTML tag (eg: <html><strong>) or #@ or @# characters. And see what happen.. You may probably get the error.. If you don’t wanna get this error then you have to set the page directive validateRequest to false. Note that your page might has the security problem.
Ref: http://codebetter.com/blogs/peter.van.ooijen/archive/2005/10/21/133505.aspex
Hope it helps..
-- modified at 11:14 Monday 26th November, 2007
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
It may be that your post included tag symbols < and/or > which are, as the error said, "potentialy dangerous". Try removing them, or replacing with < and > and try again...
You can prevent this by adding a
ValidateRequest="False"
page directive but you should only do this if you trust anyone who is able to post to this page, or else parse their input very carefully...
cheers
fred
|
|
|
|
|
The post itself doesn't have any tags or formatting inlcuded by me, but it appears as if the javascript editor that the blog code uses adds the tags as I type. I'm not going to set the ValidateRequest to false (for obvious reasons, but I may have to recommend that we find a different editor.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's easy to get paranoid about this sort of thing, but after all these CP forums use just such an editor - allowing html tags to be posted back to the server - and AFAIK the world hasn't ended... yet!
|
|
|
|
|
John Simmons / outlaw programmer wrote: I was entering a blog entry in one of our company's web apps, and I got this error when I submitted the post
It means the app was written by idiots who don't test. We have them writing web apps for us too. They're instantly recognizable by their ridiculously long (for something with few users on an internal server) load times and complete lack of any working contact or bug reporting information.
---- ...the wind blows over it and it is gone, and its place remembers it no more...
|
|
|
|
|
When ever I try to reset the dropdown by javascript a page load happens. Could you please let me know how can I reset the listbox or dropdown value.
My code is as below on ASP.NET page load is as below:
Button1.Attributes.Add("onClick", "document.getElementById('<% =FromHyperlink.ClientID %>').selectedIndex=1; return false;");
Regards,
Pavas
-----------------------
[http://longjump.com/]
Dynamic business applications that manage and coordinate teams and information
-----------------------
|
|
|
|
|
<br />
Button1.Attributes.Add("onClick", string.Format("javascript:document.getElementById('{0}').selectedIndex=1; return false;",FromHyperlink.ClientID )); <br />
-----
|
|
|
|
|
Hi,
I am in need to use custom membership provider with Custom DB Schema. The new schema defined has some additional fields against those defined by default schema. In the overridable method CreateUser i am not able to pass the remaining field values (since it is overriding the method signature defined in the MembershipProvider class) for further processing... Is there any approach to overcome this problem ? Thanx in advance.
Prashanth Nandi
|
|
|
|
|
I want to know how to use find control in gridview.if any one know please help its urgent..
Rock Star
|
|
|
|
|
can u tell vats ur need ...
|
|
|
|
|
loop through the grid view and use row.findcontrol something like this:
<br />
foreach(GridViewRow gvRow in gv.Rows)<br />
{<br />
yourcontrol = gvRow.FindControl(controlid);<br />
}<br />
-----
|
|
|
|
|
Hi,
this code work true in first click, and in second don't fire Click event of btn.
in per twice run (first fire click event, second no).
if change the Form_Load to :
if (!IsPostBack)
{
Add();
}
in first click the btn disappears!
I use such this code in my project, what should I do for true action(in each click fires click event)
**** There is a Table control (tbl) on my web form ****
protected void Page_Load(object sender, EventArgs e)
{
Add();
}
private void Add()
{
tbl.Rows.Clear();
TableRow tr = new TableRow();
TableCell tc = new TableCell();
Button btn = new Button();
btn.Text = "Click Me!";
btn.Click += new EventHandler(btn_Click);
tc.Controls.Add(btn);
tr.Controls.Add(tc);
tbl.Controls.Add(tr);
}
void btn_Click(object sender, EventArgs e)
{
Add();
}
Best wishes
|
|
|
|
|
Have you figured this out?
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
No, and it's crucial for me!!
Best wishes
|
|
|
|
|
I have the following code, i have checked this with other versions of .net 2003 and 2005 to make sure it worked, but when i tried using the new web developer 2008 express it won't recognize the mail.mailmessage and smtpmail. If any one can see where i'm goin wrong please let me know.
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Mail
Partial Class Volunteer
Inherits System.Web.UI.Page
Protected Sub btn_submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_submit.Click
Dim mailmessage As New Mail.MailMessage
mailmessage.From = "noreply@paulmcgann.net"
mailmessage.To = "noreply@paulmcgann.net"
mailmessage.Subject = "Sending Emails using asp.net"
mailmessage.Body = "Initalizing an email to be sent from asp.net application"
mailmessage.Priority = MailPriority.High
SmtpMail.SmtpServer = "localhost"
SmtpMail.Send(mailmessage)
End Sub
End Class
|
|
|
|
|
Name space changed to System.Net.Mail
|
|
|
|
|
|
hi,,
i hve a datalist with a linkbutton and a label. both have same values. from A to Z. so , i want to get the value which we click. ie, if i click linkbtn with letter 'J' i hve to get that letter.. i used a code
dim lkbtn as linkbutton = Ctype(e.item.findcontrol("linkbtn"),Linkbutton)
dim s as string = lkbnt.text
but its not working..
thanks in advance..
Cheers..
|
|
|
|
|
Hi all,
I m getting the following error
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
and following is my code
Dim connstr As String = String.Empty<br />
Dim notes As String = String.Empty<br />
Dim oldbconn As New OdbcConnection(ConfigurationManager.ConnectionStrings("DBConnectionString").ToString())<br />
Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubmitButton.Click<br />
If Job_Notes.Text = "" Then<br />
notes = "No notes"<br />
Else<br />
notes = Job_Notes.Text<br />
End If<br />
Dim oldbcmd As New OdbcCommand()<br />
connstr = "insert into JOB_HR_Details(Job_Type,Job_Title,Job_Description,Location_ID,Qualification,Years_of_Experience,Competencies_Desired,"<br />
connstr += "Competencies_Technical,Email_ID,Notes,Status) values('" & Job_Type_DDL.SelectedValue & "','" & Job_Title_TXT.Text & "','"<br />
connstr += JOB_Description.Text & "'," & Location_DDL.SelectedValue & ",'" & Qualification.Text & "'," & Experience_DDL.SelectedValue & ",'" & Des_Comp.Text & "','"<br />
connstr += Tech_Comp.Text & "','" & Emp_Email_ID.Text & "','" & notes & "','0');"<br />
oldbcmd.CommandText = connstr<br />
oldbcmd.Connection = oldbconn<br />
oldbconn.Open()<br />
oldbcmd.ExecuteNonQuery()<br />
oldbconn.Close()
can anybody help me out whats causing the problem....
and can we use stored proc in oracle? if yes can anyone translate the above query to a proc
thanks in advance...
When you fail to plan, you are planning to fail.
|
|
|
|