Dot net Framework 2.0 is easy to design software or web page.This platform can easily create various management software and also web application.In dot net framework 2.0 have three different languages vb,c# and j#.I discussed about two languages.I think it is helpful for new programmer.Best of luck.Thanks .Parves.
The RoleGroups property contains the content templates associated with various roles on the Web site. The collection in the RoleGroups property is searched in the order in which templates are defined in the source. The first matching role-group template is displayed to the user. If a user is a member of more than one role, the first role-group template that matches any of the user's roles is used. If more than one template is associated with a single role, only the first defined template will be used.
If a logged-in user does not belong to any role contained in the role-group collection, the site displays the content template specified in the LoggedInTemplate property. Anonymous users are never shown any template contained in the RoleGroups collection.
asp:LoginView ID="LoginView1" runat="server" RoleGroups asp:RoleGroup Roles="admin" ContentTemplate Add a new article.br Review editorial changes.br View article requests.br your a logged in here as a Adminbr ContentTemplate asp:RoleGroup asp:RoleGroup Roles="superuser" ContentTemplate Add a new article. Review editorial changes. View article requests. your a logged in here as a Superuser.
ContentTemplate asp:RoleGroup RoleGroups LoggedInTemplate You Are Logged in here as a normal user LoggedInTemplate AnonymousTemplate asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="#E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" TextBoxStyle Font-Size="0.8em" LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeColor="#284775" InstructionTextStyle Font-Italic="True" ForeColor="Black" TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9em" ForeColor="White" asp:Login AnonymousTemplate asp:LoginView
Note : if you need Example code. mail me at rezakawser@yahoo.com
Passing parameters from one page to another is a very common task in Web development. Granted, its importance and frequency has faded a bit with ASP.NET's inherent preference for postback forms, but regardless, there are still many situations in which you need to pass data from one Web page to another. There are three widely used methods of passing values from one page to another in ASP.NET
1. Using Query String We usually pass value through query string of the page and then this value is pulled from Request object in another page.
This is the most reliable way when you are passing integer kind of value or other short parameters.
More advance in this method if you are using any special characters in the value while passing it through query string, you must encode the value before passing it to next page. So our code snippet of will be something like this:
Note that we are navigating to another page using Server.Transfer instead of Response.Redirect.
Some of us also use Session object to pass values. In that method, value is store in Session object and then later pulled out from Session object in Second page.
3. Posting form to another page instead of PostBack Third method of passing value by posting page to another form. Here is the example of that:
Here we are posting the form to another page instead of itself. You might get viewstate invalid or error in second page using this method. To handle this error is to put EnableViewStateMac=false
4. Another method is by adding PostBackURL property of control for cross page post back
In ASP.NET 2.0, Microsoft has solved this problem by adding PostBackURL property of control for cross page post back. Implementation is a matter of setting one property of control and you are done.
In above example, we are assigning PostBackUrl property of the button we can determine the page to which it will post instead of itself. In next page, we can access all controls of the previous page using Request object.
You can also use PreviousPage class to access controls of previous page instead of using classic Request object.
As you have noticed, this is also a simple and clean implementation of passing value between pages.
Passing values between pages is another common task accomplishes in web based development. As we have discussed many of mechanisms above, I prefer and recommend to use Query String then other methods for its clean and simple implementation as long as your parameter doesnt have security concern.
In this article, we will see how to create a database connection between ASP.NET(C#).We will explore design a website and write server code for this project.
In this articles insert, update, delete and search data from MS access database ASP.NET 2.0 and ASP.NET 3.5 (language C#).we had discussed how to save and retrieve images in the database. In this article, we will build on that concept and use the same technique to display data in a grid view.
We will learn how to insert an data and then display the data on the same page with details view . At the end of this article, you will also learn how to use the database in ASP.NET 2.0 and ASP.NET 3.5 (language C#). If you are unfamiliar with the gridview control, I suggest you to read the gridview control in ASP.NET 3.5 to get an understanding of the same
Let us start off by first creating a sample database and adding a table to it. We will call the database ‘SampleDB’ and the table will be called ‘Info_TBL’. This table will contain some column along with some other columns.
Step 1: Create a new ASP.NET website. In the code-behind, add the following namespace
C#
using System.Data.OleDb;
Step 2: Drag and drop table, label, textbox and button control as much we need. Also drag drop some validation control as we need. The source would look similar to the following:
OleDbConnection cn = new OleDbConnection(ConnectionStringSampleDB);
cn.Open();//Open connection
string strserch = "Select * from Info_TBL Where Name='" + txtSearch.Text + "'";
OleDbDataAdapter da = new OleDbDataAdapter(strserch, cn);// create data adapter
DataTable dt = new DataTable();//declare data table
DataSet ds = new DataSet();// declare a data set
da.Fill(ds, "Info_TBL");//
dt = ds.Tables["Info_TBL"];
if (dt.Rows.Count > 0)//search data is present or not
{
txtName.Text = dt.Rows[0]["Name"].ToString();
txtEmail.Text = dt.Rows[0]["Email"].ToString();
txtPhone.Text = dt.Rows[0]["Phone"].ToString();
txtAdd.Text = dt.Rows[0]["Address"].ToString();
txtJob.Text = dt.Rows[0]["Job"].ToString();
txtComments.Text = dt.Rows[0]["Comments"].ToString();
In the code above, we are creating a connetion. In this connection four operations are performed.
Step 4: In order to display the data Gridview on the page, first we will add a Gridview then we will create another connections and query String then we will bind the whole data with Gridview.