Click here to Skip to main content
16,004,906 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Can i add the database item to drop down list Pin
Imran Khan Pathan3-Aug-08 22:57
Imran Khan Pathan3-Aug-08 22:57 
AnswerRe: Can i add the database item to drop down list Pin
Anand Desai3-Aug-08 23:26
Anand Desai3-Aug-08 23:26 
GeneralRe: Can i add the database item to drop down list Pin
Imran Khan Pathan3-Aug-08 23:50
Imran Khan Pathan3-Aug-08 23:50 
AnswerRe: Can i add the database item to drop down list Pin
Anand Desai3-Aug-08 23:57
Anand Desai3-Aug-08 23:57 
AnswerRe: Can i add the database item to drop down list Pin
Sandeep Akhare4-Aug-08 0:35
Sandeep Akhare4-Aug-08 0:35 
GeneralRe: Can i add the database item to drop down list Pin
Anand Desai4-Aug-08 0:47
Anand Desai4-Aug-08 0:47 
AnswerRe: Can i add the database item to drop down list Pin
chandralekha4-Aug-08 1:53
chandralekha4-Aug-08 1:53 
Question(i m in big prob and need help) How to Assign Some text in a text box in Detail view Pin
Member 46590013-Aug-08 21:47
Member 46590013-Aug-08 21:47 
i m assignning some text in a text box which is in DetailsView
in Page load event using find control

there is not any error message showing in it but text in a text box which is in DetailsView is not shown

I m giving code what i done



Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then

Dim txtmachine As TextBox = New TextBox
txtmachine = CType(dvwProduct.FindControl("txtMachineId"), TextBox)

If Request.QueryString("ID") IsNot Nothing Then
txtmachine.Text = Request.QueryString.Get("ID").ToString()
Dim MachineDataSet As DataSet = New DataSet()
MachineDataSet = MachineDB.SelectMachinebyId(Request.QueryString.Get("ID").ToString())
If MachineDataSet.Tables(0).Rows.Count > 0 Then
txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("txtMachineName"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("MachineName").ToString()

txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("txtDescription"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("MachineShortDescription").ToString()

txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("txtSpecification"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("MachineSpecification").ToString()


Dim chkmachine As CheckBox = New CheckBox()
chkmachine = CType(dvwProduct.FindControl("checkIsAvailable"), CheckBox)
chkmachine.Checked = True

' chkmachine.Text = MachineDataSet.Tables(0).Rows(0)("MachineName").ToString()

txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("MachineCostCenterTextBox"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("MachineCostCenter").ToString()


txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("ManPowerTextBox"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("ManPower").ToString()

txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("CapecityTextBox"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("Capecity").ToString()

txtmachine = New TextBox
txtmachine = CType(dvwProduct.FindControl("ProcessNameTextBox"), TextBox)
txtmachine.Text = MachineDataSet.Tables(0).Rows(0)("ProcessName").ToString()

'MachineName()
'MachineShortDescription()
'MachineSpecification()
'checkIsAvailable()
'MachineCostCenter()
'ManPower()
'Capecity()
'ProcessName()
End If

Else

System.Web.HttpContext.Current.Session("CompanyID") = SessionData.ActiveInstance.SessionFilters("CompanyID").ToString
System.Web.HttpContext.Current.Session("DivisionID") = SessionData.ActiveInstance.SessionFilters("DivisionID").ToString
System.Web.HttpContext.Current.Session("DepartmentID") = SessionData.ActiveInstance.SessionFilters("DepartmentID").ToString


txtmachine.Text = MachineDB.ReturnId()

End If

End If
End Sub





and aspx page


]]>
<asp:content id="Content1" contentplaceholderid="_header" runat="Server" xmlns:asp="#unknown">

<asp:content id="Content2" contentplaceholderid="_lockinfo" runat="Server" xmlns:asp="#unknown">

<asp:content id="Content3" contentplaceholderid="_mainContent" runat="Server" xmlns:asp="#unknown">

<asp:detailsview id="dvwProduct" runat="server" autogeneratedeletebutton="True" autogenerateeditbutton="True">
AutoGenerateInsertButton="True" AutoGenerateRows="False" DataKeyNames="ID" DataSourceID="objCurrProduct"
DefaultMode="Insert" HeaderText="Product Details" >
<fieldheaderstyle width="108px">
<fields>
<asp:templatefield headertext="Machine Id" sortexpression="DepartmentID">
<itemtemplate>
<asp:label id="lblMachineId" runat="server" text="<%# Eval(" machineid")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="txtMachineId" runat="server" text="<%# Bind(" machineid")="" %&gt;"="" width="300px">


<asp:templatefield headertext="Machine Name" sortexpression="DepartmentID">
<itemtemplate>
<asp:label id="lblMachineName" runat="server" text="<%# Eval(" machinename")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="txtMachineName" runat="server" text="<%# Bind(" machinename")="" %&gt;"="" width="300px">


<asp:templatefield headertext="Description" sortexpression="Title">
<itemtemplate>
<asp:label id="lblDescription" runat="server" text="<%# Eval(" machineshortdescription")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="txtDescription" runat="server" text="<%# Bind(" machineshortdescription")="" %&gt;"="" width="300px">


<asp:templatefield headertext="Specification" sortexpression="Description">
<itemtemplate>
<asp:label id="lblSpecification" runat="server" text="<%# Eval(" machinespecification")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="txtSpecification" runat="server" text="<%# Bind(" machinespecification")="" %&gt;"="" textmode="MultiLine" height="30" width="300px">



<asp:templatefield headertext="Is Available" sortexpression="SKU">
<itemtemplate>
<asp:checkbox id="checkIsAvailable" runat="server" width="300px">




<asp:templatefield headertext="Machine Cost Center" sortexpression="MachineCostCenter">
<itemtemplate>
<asp:label id="lblMachineCostCenter" runat="server" text="<%(" machinecostcenter")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="MachineCostCenterTextBox" runat="server" text="<%# Bind(" machinecostcenter")="" %&gt;"="" width="300px">


<asp:templatefield headertext="ManPower Used By Machine" sortexpression="ManPower">
<itemtemplate>
<asp:label id="lblManPower" runat="server" text="<%(" manpower")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="ManPowerTextBox" runat="server" text="<%# Bind(" manpower")="" %&gt;"="" width="300px">


<asp:templatefield headertext="Capecity Of Machine" sortexpression="Capecity">
<itemtemplate>
<asp:label id="lblCapecity" runat="server" text="<%(" capecity")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="CapecityTextBox" runat="server" text="<%# Bind(" capecity")="" %&gt;"="" width="300px">

<asp:templatefield headertext="Process For Machine " sortexpression="ProcessName">
<itemtemplate>
<asp:label id="lblProcessName" runat="server" text="<%(" processname")="" %&gt;"="">

<edititemtemplate>
<asp:textbox id="ProcessNameTextBox" runat="server" text="<%# Bind(" processname")="" %&gt;"="" width="300px">






<asp:objectdatasource id="objCurrProduct" runat="server" insertmethod="InsertProduct">
SelectMethod="SelectMachinebyId" TypeName="MachineDB" >
<selectparameters>
<asp:querystringparameter name="MachineId" querystringfield="ID">

<insertparameters>
<asp:parameter name="MachineID" type="String">
<asp:parameter name="MachineName" type="String">
<asp:parameter name="MachineShortDescription" type="String" convertemptystringtonull="false">
<asp:parameter name="MachineSpecification" type="String" convertemptystringtonull="false">
<asp:parameter name="MachineCostCenter" type="String" convertemptystringtonull="false">
<asp:parameter name="ManPower" type="int32">
<asp:parameter name="Capecity" type="int32">
<asp:parameter name="ProcessName" type="String" convertemptystringtonull="false">
<asp:sessionparameter name="CompanyID" sessionfield="CompanyID">
<asp:sessionparameter name="DivisionID" sessionfield="DivisionID">
<asp:sessionparameter name="DepartmentID" sessionfield="DepartmentID">











Raghvendra

AnswerRe: (i m in big prob and need help) How to Assign Some text in a text box in Detail view Pin
Imran Khan Pathan3-Aug-08 23:17
Imran Khan Pathan3-Aug-08 23:17 
QuestionProblem with UpdatePanel And ListBox as Select ListBox Pin
Bardia Shahini3-Aug-08 21:37
Bardia Shahini3-Aug-08 21:37 
AnswerRe: Problem with UpdatePanel And ListBox as Select ListBox Pin
eyeseetee3-Aug-08 21:42
eyeseetee3-Aug-08 21:42 
AnswerRe: Problem with UpdatePanel And ListBox as Select ListBox Pin
Abhijit Jana3-Aug-08 21:48
professionalAbhijit Jana3-Aug-08 21:48 
QuestionRe: Problem with UpdatePanel And ListBox as Select ListBox Pin
Bardia Shahini4-Aug-08 20:24
Bardia Shahini4-Aug-08 20:24 
QuestionServer site problem Pin
krishnaveer3-Aug-08 21:28
krishnaveer3-Aug-08 21:28 
QuestionRe: Server site problem Pin
Abhijit Jana3-Aug-08 21:32
professionalAbhijit Jana3-Aug-08 21:32 
AnswerRe: Server site problem Pin
krishnaveer3-Aug-08 21:45
krishnaveer3-Aug-08 21:45 
AnswerRe: Server site problem Pin
Abhijit Jana3-Aug-08 22:50
professionalAbhijit Jana3-Aug-08 22:50 
GeneralRe: Server site problem Pin
krishnaveer4-Aug-08 2:33
krishnaveer4-Aug-08 2:33 
AnswerRe: Server site problem Pin
eyeseetee3-Aug-08 21:40
eyeseetee3-Aug-08 21:40 
GeneralRe: Server site problem Pin
krishnaveer3-Aug-08 21:48
krishnaveer3-Aug-08 21:48 
Questionhow to apply security Pin
gaurav mangal3-Aug-08 20:59
gaurav mangal3-Aug-08 20:59 
AnswerRe: how to apply security Pin
Abhijit Jana3-Aug-08 21:18
professionalAbhijit Jana3-Aug-08 21:18 
Questionbutton control and resource file [modified] Pin
farabba3-Aug-08 20:37
farabba3-Aug-08 20:37 
AnswerRe: button control and resource file Pin
eyeseetee3-Aug-08 21:44
eyeseetee3-Aug-08 21:44 
GeneralRe: button control and resource file Pin
farabba3-Aug-08 22:20
farabba3-Aug-08 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.