label - FormView to refer different data sources in asp.net -
i having formview in have edititemtemplate.
the formview refering 1 datasource(say datasource1) , values controls in edititemtemplate populated datasource. till here fine.
i have label in same formview, edititemtemplate should refer datasource(say datasource2). (i want value populated datasource2). how this?
i beginner. please help!!
any appreaciated!!
what have done bind element (label in case, textbox in mine) (in case) sqldatasource. control data sdstbinfo, when want write data back, use updateparameters of sqlsomething , in code behind.
in aspx code "title" sql datasource called sdstbinfo
<edititemtemplate> <asp:textbox id="someuniqueid" runat="server" text='<%# bind("title") %>' /> . .
then when want new data same control , pass different datasource....
private void onbuttonclick() { //first find control want textbox tb = fvform.findcontrol["txtboxwithnewinfo"]; //then pass it's value sql datasources update command sdssomething.updateparameter("thing").defaultvalue = tb.text.tostring(); . . . sds.update(); }
hope helps
Comments
Post a Comment