Showing posts with label ASP.NET C#. Show all posts
Showing posts with label ASP.NET C#. Show all posts

How to post html code in blog

we post this code(<a href="http://icelab.in/" target="_blank"> Ice lab </a>) in blog it will show Ice lab so we cant post html code to blog how to avoid this problem
first change < to & lt; and change > to & gt;

How to open link in new window

Open link in new window
<a href="http://icelab.in/" target="_blank"> Ice lab </a>

What is an ASP File?

What is an ASP File?
An ASP file is just the same as an HTML file
An ASP file can contain text, HTML, XML, and scripts
Scripts in an ASP file are executed on the server
An ASP file has the file extension ".asp"
How Does it Work?
When a browser requests an HTML file, the server returns the file
When a browser requests an ASP file, IIS passes the request to the ASP engine on the server
The ASP engine reads the file, line by line, and executes the scripts in the file
Finally, the ASP file is returned to the browser as plain HTML

Shortcut Keys in .NET

Shortcut Keys

KeyWhat it Does?
Ctrl + NOpens the New Project Dialogue Box
Ctrl + Shift + OOpens the Open File Dialog Box
Ctrl + Shift + AOpens Add New Item window
Ctrl + DOpens Add Existing Item window
Ctrl + SSaves Current Form
Ctrl + Shift + SSaves everything from Application
Alt + QExits Visual Studio. NET
Ctrl + ZUndo
Ctrl + Shift + ZRedo
Ctrl + XCuts your selection
Ctrl + CCopies your selection
Ctrl + VPastes your selection
Ctrl + ASelects All
DelDeletes your selection
Ctrl + FOpens Find window
Ctrl + HOpens Find and Replace window
Ctrl + Shift + HOpens Replace in Files window
Ctrl + Alt + Shift + F12Opens Find Symbol window
F7Opens Code Designer window
Shift + F7Gets you back to Design View
Ctrl + ROpens the Solution Explorer window
Ctrl + Alt + SOpens the Server Explorer window
Ctrl + Shift + COpens the Class View window
F4Opens the Properties window
Ctrl + Shift + EOpens the Resource view window
Ctrl + Alt + XOpens the Toolbar window
Shift + Alt + EnterTakes you to Full Screen View
Alt+F8Opens Macro Explorer window
F2Opens Object Browser window
Ctrl + Alt + TOpens Document Outline window
Ctrl + Alt + KOpens Task List window
Ctrl + Alt + AOpens Command window
Ctrl + Alt + OOpens Output window
Ctrl + Alt + YOpens Find Symbol Results window
Ctrl + Alt + FLists Items under the Favorites Menu in your Internet Explorer
Ctrl + Shift + BBuilds your project
F5Runs your Application
Ctrl + F5Runs your Application without Debugging
Ctrl + Alt + EOpens the Exceptions Dialog Box
F8Used while Debugging Applications
Shift + F8Used While Debugging Applications
Ctrl + BInserts a New Breakpoint
Ctrl + Shift + F9Clears All Breakpoints
Ctrl + Alt + POpens the Processes Dialog box
Ctrl + TOpens Customize Toolbox window
Ctrl + Shift + PRuns Temporary Macro
Ctrl + Shift + RRecords Temporary Macro
Alt + F11Opens Macros IDE
Ctrl + F1Opens Dynamic Help window
Ctrl +Alt + F1Opens Help window sorted by Contents
Ctrl + Alt + F2Opens Help window sorted by Index
Ctrl + Alt + F3Opens Help Search window
Shift + Alt + F2Opens Index Results window
Shift + Alt + F3Opens Search Results window

How to make paging for grid in asp.net

How to make paging for grid in asp.net
first take PageIndexChanging event and paste this code
-------------------------------------------------------------------------------------------------

protected void Gridalldisplay_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
Gridalldisplay.PageIndex = e.NewPageIndex;
grid();
}
............................................................................................................................................................................
public void grid() //function for populating grid
{
dt = obj.call("Select * from table_name");
if (dt.Rows.Count > 0)
Gridalldisplay.DataSource = dt;
Gridalldisplay.DataBind();
}
-------------------------------------------------------------------------------------------------

Read function for asp.net

Read function for asp.net

-------------------------------------------------------------------------------------------------

public DataTable read_function(string cal)
{
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cal, con);
DataTable dt = new DataTable();
da.Fill(dt);
con.Close();
return dt;
}
---------------------------------------------------------------------------------------------------

Insert function for asp.net

Insert function for asp.net
this function can used for delete,insert and update operations
-------------------------------------------------------------------------------------------------
public int insert_function_with _int_returntype(string sav)
{
int ret;
con.Open();
SqlCommand cmd = new SqlCommand(sav, con);
ret = cmd.ExecuteNonQuery();
con.Close();
return ret;
}
************************************************************************************
public void insert_function(string sav)
{

con.Open();
SqlCommand cmd = new SqlCommand(sav, con);
cmd.ExecuteNonQuery();
con.Close();

}
-----------------------------------------------------------------------------------

HOW TO ADD DATA FROM DATADASE TO GRID IN ASP.NET

FUNCTION FOR ADDING DATA FROM DATADASE TO GRID IN ASP.NET
-------------------------------------------------------------------------------------
public void grid()
{
DataTable dt = new DataTable();
string qu1 = "select * from shop_category";
dt = obj.call(qu1);
if (dt.Rows.Count > 0)
{
Gridcategory.DataSource = dt;
Gridcategory.DataBind();
}
else
{

}
}
-------------------------------------------------------------------------------------