I faced a problem to call 2 methods at the same time from body. and the solution is very simple. I wrote a script block at the end of the page look like that.
<SCRIPT LANGUAGE=”JAVASCRIPT”>
if(document.body.onload)
{
var existingOnLoad = document.body.onload;
document.body.onload = function()
{
existingOnLoad();
MyOwnMethod();
}
}
</SCRIPT>
Posted in Javascript | Tagged Javascript | Leave a Comment »
I had a very big mysql database backup file, needed to divide that in may part to import in the server. but it is hard to do and time wasting. I got a very good tool to do that. you can try that too.
http://www.ozerov.de/bigdump.php
Posted in MySql | Tagged mysql | 2 Comments »
I have faced an intersting problem in firefox, i have written a simple html like that
<hr style=”color:#FF9900″/>
it shows color in Internet Explorer but color was not showing in Firefox.
Finally i solve that problem is this was
<hr style=”border-top: 1px solid #bae1f7; “/>
Isnteresting browser issue
Posted in CSS | 9 Comments »
In web application accordion is a very nice using. By using that you can make you website good looking and in a small space you cam put many things. Here am giving you example of a dynamic Accordion which i am loading from a XML file.
To create that using AjaxControlToolkit. In AjaxControlToolkit a control named Accordion is available , i have just load this dynamically and reading data from XML.
Here are the coder to read data from XML and Load accordion dynamically
Accordion accordion = new Accordion();
accordion.ID = “AccordionID”;
accordion.SelectedIndex = 0;
accordion.FadeTransitions = true;
accordion.FramesPerSecond = 50;
accordion.TransitionDuration = 250;
accordion.SuppressHeaderPostbacks = true;
string _path = HttpContext.Current.Server.MapPath(@”Sitemap.xml”);
FileStream stream = new FileStream(_path, FileMode.Open , FileAccess.Read, FileShare.ReadWrite);
XmlDocument document = new XmlDocument();
document.Load(stream);
XmlNodeList nodeList = document.GetElementsByTagName(“Item”);
for (int i = 0; i < nodeList.Count; i++)
{
AccordionPane accorPane = new AccordionPane();
Label lbl = new Label();
lbl.ID = “lblControl”;
lbl.Text = nodeList[i].Attributes["name"].Value;
lbl.Width = 200;
lbl.BackColor = System.Drawing.Color.Wheat;
lbl.Style.Add(HtmlTextWriterStyle.MarginBottom, “3px”);
accorPane.HeaderContainer.Controls.Add(lbl);
for (int j = 0; j < nodeList[i].ChildNodes.Count; j++)
{
string name = nodeList[i].ChildNodes[j].Attributes["name"].Value;
Label lbl2 = new Label();
lbl2.ID = “lblControl2″;
lbl2.Text = name;
lbl2.Width = 195;
lbl2.BackColor = System.Drawing.Color.WhiteSmoke;
lbl2.Style.Add(HtmlTextWriterStyle.MarginBottom, “2px”);
lbl2.Style.Add(HtmlTextWriterStyle.PaddingLeft, “5px”);
HyperLink hl = new HyperLink();
accorPane.ContentContainer.Controls.Add(lbl2);
accorPane.ContentContainer.Controls.Add(new LiteralControl(“<br/>”));
}
accordion.Panes.Add(accorPane);
}
PlaceHolder1.Controls.Add(accordion);
stream.Close();
Posted in AjaxControlToolkit | Tagged Accordion, AjaxControlToolkit | 10 Comments »
I was workign with a small application where i create Accordion runtime. I i got problem for that the problem was “The TargetControlID of ‘_AccordionExtender’ is not valid. The value cannot be null or empty”. I wrote codes like that

Finally got the solution just add accordion.ID = “AccordionID” and this problem is solved. So the fixed code is look like that

Posted in AjaxControlToolkit | Tagged Accordion, AjaxControlToolkit | 4 Comments »
Now a day’s event management is becoming a very popular idea especially in case of web application development. Most of the application is synchronizing with outlook contacts and calendar. Here is a small tool to create event both hour event and day event. This concept is very simple creating a ics file and sending as mail attachment.

I have written an small article on how to send event through mail. Please check here to get complete code.
http://www.codeproject.com/KB/applications/SendAppointment.aspx
Posted in C#.NET | Tagged Send appointment | Leave a Comment »
ASP.NET 3.5 introduces a new data binding control named the ListView. ASP.NET already has a lot data bind control; it should be more than 10. But the good news is, ListView can literally replace all other data binding controls in ASP.NET. ListView control makes data binding easier than previous controls. It has included styling with CSS, flexible pagination, and sorting, inserting, deleting, and updating features.

I have written an article on ASP:ListView in CodeProject, Please go through it to get complete source code of ListView. My Article on ASP:ListView
Posted in C#.NET | Tagged asp.net 3.5, ListView | Leave a Comment »
I saw a nice video today in MIX site this is about Search Engine Optimization. It’s a big video and I really learnt a lot about SEO after see that. You can also see that. Just download SEO video from here and enjoy.
I have written a brief on that video hope you can learn vey basic things from here too
-
Use HTML semantically
-
Example:
Good: <H1>this is an Article</H1>
Bad: <span class=”header1”> this is an Article</span>
Because: Heading and title tag are more important to robot then span and JavaScript class.
So be careful to use of common tags its priority sequence is like that <a>, <h1>, <title>, <Meta>, <table>
-
JavaScript and CSS
Continue Reading »
Posted in SEO | Tagged SEO | 2 Comments »
Sometime we may need to import contact from client machine’s outlook, in this case we can write javascript to import outlook contacts easily. Here is the code how to do that.
var Const_olFolderContacts = 10;
var objApp = new ActiveXObject(“Outlook.Application”);
var objNS = objApp.GetNamespace(“MAPI”);
var colContacts = objNS.GetDefaultFolder(Const_olFolderContacts).Items
for( var i=1; i<=colContacts.count;i++)
{
var v = colContacts.item(i);
alert(v["FullName"]+” (“+v["Email1Address"]+”)”);
}
if this code does not works , please do the following so it should work
In Internet Explorer , go to Tools | Internet Options | Security -> from ‘Custom Level’ go to ‘Initialize and script ActiveX controls not marked as safe for scripting’ and select ‘Prompt” — this should work now
have got a big detailes code here, you can check this too another code
Posted in Outlook | Tagged import contacts, Outlook | 6 Comments »