ASP.NET

Quick Search

Hide/Show input box value on focus

November 16th, 2010 by admin
No comments »

For hiding the input box value on focus you just copy and pate the following code within you input box.

onfocus=”javascript: if(this.value==’Name’) { this.value=”;}”
onblur=”javascript: if(this.value==”) { this.value=’Name’; }”

Find row index of gridview on RowCommand without CommandArgument

October 26th, 2010 by admin
No comments »

Gridview has a template field with item linkbutton delete with CommandName now when user click on linkbutton then find the rowindex on Rowcommand event of gridview using C#.net

protected void grdtest1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == “DeleteRow”)
{
LinkButton gv = (LinkButton)e.CommandSource;
GridViewRow gvr = (GridViewRow)gv.Parent.Parent;
int rownum = gvr.RowIndex;
}
}

Replace enter key value from textbox using asp.net with c#.net and save in database

October 20th, 2010 by admin
No comments »

Problem: when I wants save multiline textbox value in database using asp.net with c#.net and show as it is its not happening ….
Actually the problem is when we enter the value in textbox and press enter key. value like this

this is jack
web developer

it save in database but … Read More

Make PNG transparency work in Internet Explorer

May 28th, 2010 by admin
No comments »

Create a container to store your image. In this case I use a <div>.
Create your <div> inside your <body>, just like this.

<body> <div></div> </body>

Next, create a <style> if you dont have one. Make sure they are between your <head> </head>. Put the following css inside.

<style>
body {background-color:#000}
div.flower {background:url(flower-transparent.png) no-repeat; height:100px; width:100px}
</style>

The … Read More

Declaring string arrays

March 17th, 2010 by admin
No comments »

First, here we observe that there are some ways to declare and instantiate a string[] array local variable. They are all equivalent in the compiled code [see note], so choose the one you think is clearest to read.

~~~ Program that initializes string arrays (C#) ~~~
 
class Program
{
    static void Main()
    {
  // … Read More