Get FreeCaptcha control with installation steps
Here you can get the Free Captcha Control...
Ref: http://www.mondor.org/captcha.aspx
Here you can get the Free Captcha Control...
Ref: http://www.mondor.org/captcha.aspx
Hi generally we are binding image to datalist..
so suppose if we store the image in the project folder
we have to get the name of the file and pass it on the src attribute of
img tag.. Ex:
here bigimages is the foldername and imagename that we will get it from database..<img src='< %#"BigImages/" & Eval("imagename") % > ' width ="485px" height="613px" border="0" />
so it will run properly..
Suppose if we do some task ie: hiding images - for that we have to
write the code in Datalist_ItemDatabound and also same for Gridview.. event has
been changed ie:ItemCommand..
At that if we use runat="server" id="Image1" for the above tag , while we get the
image through code it shows error
Unable to cast the html image to webcontrol image
for that use asp:image this is way you have to apply imageurl so it display the
image as per imagename - from the folder
<asp:Image ID="ProductImg"
CssClass="ProductImg"
runat="server"
ImageUrl=' < %# Eval("BigImages","imagename/{0}").Trim() % >'
AlternateText=' < %# Eval("imagename","").Trim() % >'
Here is the code
validation for tiny_mceEditor control
here is the code for validate the (Required field validation ) for the control< style="font-weight: bold;">OnClientClick="tinyMCE.triggerSave(false,true);
"
EGEX - Validataion Expression - [\\s\\S]{0,1000}$
To use like operator using parametrized Queries suppose if we use the like ie: wild character "%" directly through the query.
There may be attach of Sql Injection - so we have to avoid.
Here is the sample code.
// 1 . using "Like" operator with plus sign in query :
string command = "Select Name from UsersTable1 where Name Like '%'+ @Name + '%' ";
SqlCommand cmd = new SqlCommand(command);
cmd.Parameters.AddWithValue("@Name", textBox1.Text);
// 2. using percentage sign when parameter assignments :
string command = "Select UserName from UsersTable2 where UserName Like @UserName";
SqlCommand cmd = new SqlCommand(command);
cmd.Parameters.AddWithValue("@UserName", string.Format("%{0}%", textBox1.Text));
Hi , here we have to discuss the how to avoid the execution of code
While you refresh the page.. suppose if you have written the code for sending email to users.. after clicking the button the code has been executed suppose if youRefresh the same page once again the Email sent to the user so here we have to avoid the execution on code on page_Refresh
this is the code in VB.NET and C#
Vb.NET
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not IsPostBack Then
Session("CheckRefresh") = Server.UrlDecode(System.DateTime.Now.ToString())
End If
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
If Session("CheckRefresh").ToString() = ViewState("CheckRefresh").ToString() Then
Label1.Text = "Hello"
Session("CheckRefresh") = Server.UrlDecode(System.DateTime.Now.ToString())
Else
Label1.Text = "Page Refreshed"
End If
End Sub
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As EventArgs)
ViewState("CheckRefresh") = Session("CheckRefresh")
End Sub
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
}
}
protected void Button1_Click(object sender, EventArgs e)
{
if (Session["CheckRefresh"].ToString() == ViewState["CheckRefresh"].ToString())
{
Label1.Text = "Hello";
Session["CheckRefresh"] = Server.UrlDecode(System.DateTime.Now.ToString());
}
else
{
Label1.Text = "Page Refreshed";
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
ViewState["CheckRefresh"] = Session["CheckRefresh"];
}
My site is worth$16,159.24Your website value?