30 August 2008
Saturday, August 30, 2008
saAction
If you want to apply theme to Ajax Controls Toolkit, You may get following error.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'ajaxToolkit:ControlName'.
This is because it is required to register all custom user controls in to the web.config file.
So, under "pages" element create "controls" and add folofing tag in to it.
add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
Done, refresh the page. error is solved.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Unknown server tag 'ajaxToolkit:ControlName'.
This is because it is required to register all custom user controls in to the web.config file.
So, under "pages" element create "controls" and add folofing tag in to it.
add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
Done, refresh the page. error is solved.
28 August 2008
Thursday, August 28, 2008
saAction
Support you have a textbox and you want to display it's value in a label, we can face this problem that it will not show new line.
this is because the code is something like this:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
}
but now change this code by :
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text.Replace(Environment.NewLine, "
");
}
and see the result:
this is because if using "Environment" class.
this is because the code is something like this:
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text;
}
but now change this code by :
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = TextBox1.Text.Replace(Environment.NewLine, "
");
}
and see the result:
this is because if using "Environment" class.
09 August 2008
Saturday, August 09, 2008
saAction
You can create your own site's Search Menu in quick search panel of Internet Explorer or in Firefox.
Actually there will be a XML file named "OpenSearch.xml". See Here
Lets See...
I have a page and "OpenSearch.xml" file in my solution explorer.
And add "LINK" tag in head tag of "aspx" page.
head runat="server"
title saAction title
link rel="search" type="application/opensearchdescription+xml" href="OpenSearch.xml" title="saAction"
/head
Now run the page...
See the result in Internet Explorer...
See the result in Firefox...
But this is not enough, there is some other requirement see here.
Actually there will be a XML file named "OpenSearch.xml". See Here
Lets See...
I have a page and "OpenSearch.xml" file in my solution explorer.
And add "LINK" tag in head tag of "aspx" page.
head runat="server"
title saAction title
link rel="search" type="application/opensearchdescription+xml" href="OpenSearch.xml" title="saAction"
/head
Now run the page...
See the result in Internet Explorer...
See the result in Firefox...
But this is not enough, there is some other requirement see here.
08 August 2008
Friday, August 08, 2008
saAction
//use this name space.
using System.Net.Mail;
//User this code
MailMessage mail = new MailMessage();
//this is the main line to show friendly name in receiver's inbox.
mail.From = new MailAddress("saaction@myserver.com", "saAction Test Mail");
mail.To.Add("receiveremail@soomeserver");
mail.Subject = "Some Subject";
mail.Body = "see the friendly name in place of email address!";
SmtpClient objSMTP = new SmtpClient("Server IP");
objSMTP.Send(mail);
Lets' see the result.
02 August 2008
Saturday, August 02, 2008
saAction
Before few days a go, It was a requirement to create a menu dynamically and apply link in to it.
Here it is a simple example to create hyperlink to the div tag.
Here in the above image you can see that, there are two menu with div tag, If I'm using HyperLink tag it will just create hyperlink to the text only. But if I want to create HyperLink to the entire block, I will not happens with simple "A" anchor tag.
So here is that trick.
See the above image, there is a style with cursor:pointer; style. It will started to show hyperlink mouse pointer to that image tag.
Now lets add hyper link to the div tag using some javascript.
You can see that using "onClick" event of that div tag have some javascript.
onclick="document.location='./TestPage1.aspx';"
It means when user will click on that div tag it will redirect the page to the "TextPage.aspx"
Here it is a simple example to create hyperlink to the div tag.
Here in the above image you can see that, there are two menu with div tag, If I'm using HyperLink tag it will just create hyperlink to the text only. But if I want to create HyperLink to the entire block, I will not happens with simple "A" anchor tag.
So here is that trick.
See the above image, there is a style with cursor:pointer; style. It will started to show hyperlink mouse pointer to that image tag.
Now lets add hyper link to the div tag using some javascript.
You can see that using "onClick" event of that div tag have some javascript.
onclick="document.location='./TestPage1.aspx';"
It means when user will click on that div tag it will redirect the page to the "TextPage.aspx"
Subscribe to:
Posts
(
Atom
)