When I uploaded the site to the server, I got an HTTP Error 500.19 - Internal Server Error which says "Cannot add duplicate collection entry of type 'add' with unique key attribute 'name' set to 'RewriteModule'". Error was in the following line in web.configI got the solution to change the application config file from the following link:http://support.microsoft.com/kb/942055But, hosting providers...
Thursday, July 15, 2010
Friday, July 9, 2010
Issue when using AsyncFileUpload control
I tried to use AsyncFileUpload control in a page. The AsyncFileUpload control was placed inside the first view of a multiview control. The page required a querystring parameter, and if the parameter is not present, the second view of the multiviewcontrol will be shown. This check is made on the Page Load event. This causes issue on the fileupload process. It was giving error, since on the postback,...
Wednesday, July 7, 2010
Germans also are gone :-(
My two favorite teams are out from WorldCup 2010, Germany and Argentina. :-( Spain really deserve that victory over Germany.I know, it is bit late. But, I just came to a contribution from Microsoft for World Cup. So, I thought, I should share with you.Track world cup scores with exc...
Tuesday, July 6, 2010
Generate sql script with data from database
How can we copy data as well the structure and schema as sql query? We need database publishing wizard for that.Download the database publishing wizard.It will be installed at following location : C:\Program Files\Microsoft SQL Server\90\Tools\Publishing\run the exe and you can get the sql file with all the data, schema and structure of the database you sele...
Thursday, July 1, 2010
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same
When this error comes, put enableViewStateMac="false" in the tag either in the web.config or in the page where you get this err...
Wednesday, May 19, 2010
System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay
I have got this issue many times, when I try to send email using smtp. There can be several causes for this. You have to allow relay for mail to be sent to outside servers like gmail.com. For sending mail within your server you don't have to do this. You can find some helps from the following links:Help1Help2Help3The code I have used is given below:using System.Net.Mail; SmtpClient smtpClient...
Friday, April 23, 2010
Login failed for user ‘IIS APPPOOL\DefaultAppPool’
I got this issue in my system using Windows 7 Ultimate when trying to run a site which is configured to run in IIS. You can get the solution for this from the following linkRead M...
Wednesday, March 31, 2010
Grouping Gridview
Some times we want to group gridview. ZNet is a good control for this use.ZNetWe can use this for grouping and also for the comparis...
Saturday, March 13, 2010
specifying ValidationGroup in Page_ClientValidate function
Hi,We know that, Page_ClientValidate function tests if all controls meet asp.net validation criteria. This function is provided by asp.net. But, if we use more than, one validation group in the page, we may have to specify the validation group, we want to validate. For that, give like given below:Page_ClientValidate('ValGroupName')Then, it will validate only for that validation gr...
Friday, March 5, 2010
The Controls collection cannot be modified because the control contains code blocks
This is a common error. It occurs when we use <%= %> tag inside the head tag with runat="server" given. You can get rid of the error by removing the runat="server" from the head tag. But, sometimes, we want to keep that. We can use <%# %> instead of <%= %>. But, then, the value may not get bound and we may not get the value of the expression. So, when we use <%# %>, we have...
Wednesday, March 3, 2010
To access control of a User Control from an aspx page
Whenever you want to access the controls of an usercontrol, create public properties for those controls in your usercontrols and you could easily access them in your .aspx page.Here it goes how...UserControl. 1 public partial class WebUserControl : System.Web.UI.UserControl2 {3 public string TextBoxValue {4 get { return TextBox1.Text; }5 set { TextBox1.Text = value; }6 ...
Friday, February 26, 2010
DateTime.ToString formats
From the following link, you can see all types of formats we can get using DateTime.ToString() method.More I...
Converting DateTime to ShortDate in SQL
When you need to get datetime field value in short date, use the following:To get today's date in YYYYMMDD format: SELECT CONVERT(CHAR(8), GETDATE(), 112)To get today's date in mm/dd/yyyy:CONVERT(VARCHAR(10), GETDATE(), 101)Helpful L...
Monday, February 15, 2010
Showing JavaScript confirmation after Client Validation
Some time we use javascript to display alert or confirmation box on button click. But, if we are using ajax validation on that page, that will work only after post back if we click ok on the confirmation box. So, to display the confirmation box, only if the page is valid, Check this l...
Thursday, February 4, 2010
Finding the Public Key Token of dll
You have to add assembly to web.config like the followingHow to get the public token of a dll to add it to web.config?Learn M...
Wednesday, February 3, 2010
Calling method of a usercontrol from another usercontrol
I need to call the method in a usercontrol from another usercontrol. Both controls are placed in same page. If it is a web application, both controls will be in same namespace. So, we can get their names in the codebehind. for eg. if control1 is to be found from control2. both control1 and control2 are in folder controls. webapplication name is test. So the namespace would be test.control2. Since,...
Finding Controls
Check the name of the control in the rendered html. For eg. I need to find gridview "grdwSelectedCandidates" in usercontrol "SelectedCandidates.ascx" which is inside the ajax tabpanel inside ajax tabcontainer.I need to find this from another control which is placed in another tabpanel in the same container. The rendered name is "ctl00_ContentPlaceHolder1_TabContainer1_TabPanel6_SelectedCandidates1_grdwSelectedCandidates"So,...
Wednesday, January 27, 2010
For using excel file as database
For reading Excel files and getting the datastring FilePath = Server.MapPath("exmaple.xls"); DataSet myDataset = new DataSet(); string strConn = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + FilePath + @";Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1"""; OleDbConnection conn = new OleDbConnection(strConn); conn.Open(); DataTable...
Tuesday, January 26, 2010
Firebug Extensions
Firebug is the most usefult addon tool for web development. It can help us to find the issues in css, ajax requests etc and many features. There are some other addons which can help to improve the utility of firebug. Learn M...
Monday, January 25, 2010
6-Hour Work At Home Video Certification Course
This Video Course Teaches How To Work From Home With Fortune 500 Companies. Great help for those like me who want to earn by working from home.Learn M...
Saturday, January 23, 2010
Ajax and UpdatePanel performance improvement
Most of the newbie programmers like me are ajaxifying a site by putting updatepanels all over the site. Now, I came to know that, putting updatepanel will not help you to improve your site's speed. We are using it, since it is very easy. You can understand why ajax updatenpanels should be avoided from the following linkWhy UpdatePanel Dangerous If you still want to use updatepanel, check the...
Top Money giving Paid To Click site
Its an off topic. I just came to know about this site. They are giving the maximum for click. 50 cents for just clicking banners and 1 USD for reading their emails. Also, referral bonus is there.
payingptr....
Friday, January 22, 2010
Know the control which caused the postback
I got this from some site. It can be used to know the control which caused the postback.
public static Control GetPostBackControl(Page thePage)
{
Control myControl = null;
string ctrlName = thePage.Request.Params.Get("__EVENTTARGET");
if (((ctrlName...
Limit in Argument size for functions
I was trying to insert data to a sql table from code behind. But, when I tried to see the values using break point, I was not able to see the values. The following link shows the cause and reason.
Help L...
How to Register User Controls and Custom Controls in Web.config
If we register controls in the web.config, we don't have to register the control on each page. This is useful, if we have to use the same control on several pages.
Help L...
Display updateprogress in the clicked position
On the following example, progress bar(UpdateProgress1) is displayed on the position of the button which got clicked
function pageLoad()
{
var manager = Sys.WebForms.PageRequestManager.getInstance();
...
JQuery default functions
Following is the jquery default function that is run. we can use this to get the ajaxrequests
function pageLoad() {
if (!Sys.WebForms.PageRequestManager.getInstance().get_isInAsyncPostBack()) {
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(AjaxBegin); ...
Use ScriptManager.RegisterStartupScript, when using ajax updatepanel to add javascript from codebehind.for eg. just showing a message box, on of a button in updatepanel ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "scriptname", "var position=$('#" + Btn.ClientID + "').offset();$('#').html('Button clicked').css(position).fadeIn(2000).fadeOut(2000);", true);can get position using...
First Post
My First Post. Hope this blog will help me and others too.I am going to post all the new things I am learning everyday regarding programming. Hope it helps somebo...