RegisterForEventValidation can only be called during Render() .net error
The following error cause due EventValidation.
RegisterForEventValidation can only be called during Render() ;
we can fix this error in a simple manner. just add EnableEventValidation=”false” in your page tag of the ASPX page.
if you feel very hard to find just add this tag below the Page tag
<%@ Page EnableEventValidation=”false” %>
Hope this will solve the issue.
Happy coding.
SQL server 2005 Select value with Replace
Hai all,
here i am going to show how to replace some special characters from the SQL server 2005 select query.
select replace(replace(replace(replace(replace(ColumnName,'(‘,”),’)’,”),’#’,”),’&’,”),’/’,”) from yourTableName;
this above query will replace some special characters like(#,&,(,),/). it will be more helpfull if we need to replace many characters from single Column value.
Same way we can replace any characters for a string.
for example we can replace a string value Lips to Loves by using the below SQL Query.
select replace(ColumnName,’lips’,’Loves’) from TableName
I hope this will help some one.
Happy Coding.
Asp.net Authentication Required Popup in Firefox and IE
I have sometimes found problems with ‘broken permission chains’ in Windows whereby some of the lower level directories are not set to inherit the permissions of the parent, and this then leads to authentication issues. You can try the following:
Navigate to root web directory in windows explorer, right-click and select ‘properties’
Select the security tab, and click the ‘advanced’ button
Check the checkbox labelled something like ‘replace all entries on child objects with entries shown here’
Click OK, and OK again on the previous window, and try again.
This will solve the issue.
Happy coding.
Asp.net dynamic menu without XML
Thats it now you got New Dynamic Horizontal menu.
Note for IE8:
please add the follwoing CSS in you page.
<style type=”text/css”>
.adjustedZIndex
{
z-index: 1;
}
</style>
asp.net Email with Images
This is very simple code to send Email with images. Here i’m going to demo how to send a email with image within the email body. its not an attachment image. the image will paced inside email body. in this example i used html as string. its very easy to design email body.
here in this string Html we need to use Escape sequence for every “”(example: img tag alt must be like alt=\”abczs\”).
also don’t forget to use the below name space to send email. This is very important <img src=’http://www.yourwebsite.com/Images/headerimage.jpg’ /> same way you can add any number image.
<% @Import Namespace=”System.Web.Mail” %>
MailMessage msgMail = new MailMessage();
msgMail.To = “udayasankar@us.com”;
msgMail.Cc = “myfriend@in.Com”;
msgMail.From = “noreply@yoursite.com”;
msgMail.Subject = “Email with Images”;
string body = “<table width=”600″ height=”600″ border=”0″ align=”center” cellpadding=”0″ cellspacing=”0″ id=”Table_01″><tr><td width=”600″ height=”176″ align=”left” valign=”top”> <img src=’http://www.yourwebsite.com/Images/headerimage.jpg’ border=0 hspace=0 alt=”headerimage”” />This is sample email from {username}.</td> </tr>”;
body = body.Replace(“{username} “, “Firstnametextbox.text”);
msgMail.IsBodyHtml = true;
SmtpClient mailSender = new SmtpClient(“localhost”); //use this if you are in the development server else use your mail settings from web config.
mailSender.Send(msgMail);
we can embed images in emails with LinkedResource and AlternateView. i don’t think its very easy so i choose this ways. but never say its an wrong way of emailing. for simple process i used this email format.
Happy coding.
Top 10 Sites
Here i post one of the top 10 sites which is more useful for a freshers. we can create free account except the last one. also we can post our Questions to get any suggestions.
These site provide a wide solution for our daily errors.
If any one have more sites better then this list,please post here.
- 1. asp.net
2. codeproject
3. beansoftware
4. dotnetspider
5. c-sharpcorner
6. dotnetfunda
7. dynamicdrive
8. w3schools
9. developerfusion
10. experts-exchange
Hello world!
Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!