IMO, there are two basic ways to read the value at the server side:
+ Get reference to the textbox and read the value, you can either use the FindControl method or the Controls collection.
+ Use the Request object to read the posted value under the textbox name.
hi all, i am bind a formview with datasource if the datasource is empty i want to formview is in add record mode. if datasource is not empty its work each(edit , add new ) in proper way.
pls give the solution ASAP,
Basically, to change the current mode of the FormView you can use the ChangeMode method with the FormViewMode.Insert . Here, if you programmatically bind the datasource to the control, you can simply do a checking on the length of the datasource. In case of using a datasource control, you can create a handler for the Selected event of the datasource control, then you can check the AffectedRows to see if you need to change the mode of the FormView.
There are a couple of the entries in the Options dialog box which you might be interested in, you can open from the Options dialog box from the Tools menu:
+ In the left pane, choose the Html designer.
+ In the left pane, choose Text Editor | HTML.
I m working on a project in asp.net 2.0.
I want to see "web form designer generated code" in dotnet 2.0.
In dotnet 1.1 we can see this in code behind file(e.g cs file). But in dotnet 2.0 code behind file does not show this.
Imanage to insert data from textbox into data table and bind that datatable to datagrid. actually I want following things
I am making an application in which I have to insert data in data table .and bind that datatable to datagrid.
1) but i want to insert this values from datagrid footer or datatable footer how to do that.
2) also i want to update the row of data grid . I am not using database for that . how to update a single row of datagrid from using data table there is no transection with database.
The code i wrote is follow
Dim TB As DataTable
Dim TR1 As Data.DataRow
Dim td1 As DataColumn
Dim TD2 As DataColumn
Dim td As DataColumn
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Me.IsPostBack = False Then
TB = New DataTable
td1 = New DataColumn
td1.ColumnName = "SHAPE"
td1.DataType = GetType(String)
td1.AllowDBNull = False
Sub AddToCart(ByVal sender As System.Object, ByVal e As System.EventArgs)
TB = Session("DiaDetails")
TR1 = TB.NewRow
TR1("Shape") = txtshape.Text
TR1("Size") = txtsize.Text
Datagrid1.DataSource = TB
Session("DiaDetails") = TB
Sub Delete_Item(ByVal s As Object, ByVal e As DataGridCommandEventArgs)
Private Sub Datagrid1_EditCommand(ByVal source As Object, ByVal e As tem.Web.UI.WebControls.DataGridCommandEventArgs) Handles Datagrid1.EditCommand
Datagrid1.EditItemIndex = e.Item.ItemIndex
Private Sub Datagrid1_UpdateCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles Datagrid1.UpdateCommand
Dim strshape As String = CType(Datagrid1.Items(Datagrid1.EditItemIndex).Cells(1).Controls(0), TextBox).Text
Dim strid As String = Datagrid1.Items(Datagrid1.EditItemIndex).Cells(0).Text
Datagrid1.EditItemIndex = -1
in my application, i am using outlook 11.0 to send mail to the recipient whose address stored in excel. i am fetching excel and stored the address in grid view and sending the mail. For me the mail should send to all the recipients but one mail at a time. after sendnig the first mail the next mail should send. i used for loop for this. but very first email id is sending properly thro outlook. but for the next loop it gives error that item moved or deleted. i give the code. please help.
Outlook.Application o = new Outlook.ApplicationClass();
Outlook.MailItem myMail = (Outlook.MailItem)o.CreateItem(Outlook.OlItemType.olMailItem);
for (int i = 0; i < GridView1.Rows.Count; i++)
myMail.Subject = "Check";
myMail.Body = "Its a Demo Mail. Good Afternoon";
myMail.Attachments.Add("C:/New1.txt", Missing.Value, Missing.Value, Missing.Value);
I am using Visual Studio 2003 and SQL Server 2000 to try and develop an E-Commerce website. Amongst others I have a Customers table, Suppliers table and a Roles table in the database. What is the standard procedure regarding storing usernames and passwords? At the moment I have Username and Password columns, as well as a foreign key column to the Roles table, in the Customers table as well as in the Suppliers table.
On my login page I have two radiobuttons so the user can specify whether they are logging in as a Customer or a Supplier. That determines then in which table I go to check the username and password. If the user is a valid user, the following line of code runs:
The problem is that then I do not know how to use the Application_AuthenticateRequest() method in the Global.asax.cs. How would I specify in there which database table to be accessed to retrieve the roles? I tried using session variables, but they were not accepted in the Application_AuthenticateRequest() method.
protectedvoid Application_AuthenticateRequest(Object sender, EventArgs e)
//??? How to specify here which table to access
string roles = Access_Customers.GetCustomerRoles(HttpContext.Current.User.Identity.Name);
HttpContext.Current.User = new GenericPrincipal(HttpContext.Current.User.Identity, roles);
Am I missing the point completely here? Is there a better way of approaching this? Perhaps have all login data (usernames and passwords in one table)?
What is better from a security point of view to use in authentication and authorization: Cookies or Session variables?
If you have defined roles, user and password in database, then why u r using Application_AuthenticateRequest(Object sender, EventArgs e) event of globaal.cs. You can directly access through database by forms submit button.
i want to know how should i return values from jagged arrays
public string fync(Type webtype)
string dimen= new string;
dimen = getDetails(Type Webtype);
//how should i collect values in dimen
public string getDetails(Type webtype)
//suppose ss is jagged array of dimension ss
//ie i have ss = i have something
// ss= i have something else
// ss= i have some third item
I hope i am doing right
Last Visit: 31-Dec-99 18:00 Last Update: 3-Oct-23 22:01