Click here to Skip to main content
15,898,134 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: WoW Slider now showing the image Pin
Sandeep Mewara5-Jan-13 20:09
mveSandeep Mewara5-Jan-13 20:09 
QuestionUnable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
amsedky5-Jan-13 1:00
amsedky5-Jan-13 1:00 
AnswerRe: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
Sandeep Mewara5-Jan-13 20:24
mveSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pin
ashraf almashhari4-Jan-13 21:46
ashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net Pin
Sandeep Mewara4-Jan-13 22:14
mveSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net Pin
Manjunath Hegde4-Jan-13 0:41
Manjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net Pin
Rahul Rajat Singh4-Jan-13 1:04
professionalRahul Rajat Singh4-Jan-13 1:04 
QuestionInsert/Update/Delete Records in Dynamic Generated Textbox/Checkbox and Loop Through All Records Pin
guodl3-Jan-13 10:11
guodl3-Jan-13 10:11 
Hi,

Please enlight me how to insert/update/delete records based on generated textbox/checkbox.

I used the following code to generate the textbox/checkbox:

ASP.NET
<asp:Repeater ID="myRepeater" runat="server" >
 <HeaderTemplate>
     <table >
        <thead><tr>
          <th>Terminal Tab</th>
          <th>Terminal Attributes</th>
          <th>Values
        </th></tr></thead>
        <tbody>
 </HeaderTemplate>
        
 <ItemTemplate>
          <tr>
    	      <td><%# Eval("TabName") %></td>
	      <td><%# Eval("TagName") %></td>
              <td><%# GenerateTag(Eval("Datatype"))%></td>
          </tr>
 </ItemTemplate>
 <FooterTemplate>
            </tbody>
            </table>
 </FooterTemplate>
</asp:Repeater>


Below is the function of GenerateTag:

C#
/// <summary>
/// Generate tages based on data type.
/// </summary>
/// <param name="objDataType"></param>

protected string GenerateTag(object objDataType)
{
    String strTags = "";

    switch (objDataType.ToString()) {
        case "Char":
            strTags = "<input id=tagText type=text  />";
            break;
        case "Int":
            strTags = "<input id=tagInt type=text  />";
            break;
        case "Boolean":
            strTags = "<input id=cbx type=checkbox  />";
            break;
        default:
            strTags = "<input id=strInput type=text />";
            break;
    }
    return strTags;
}


I use the following SQL statement in myRepeater:

C#
           string strSQL = @"
        Select       T.ID
                              , T.TabID  TabID
                              , Tab.Name TabName
                              , T.TagName
                              , T.AppID
                              , T.DataType
                              , T.MinLen
                              , T.MaxLen
                              , A.Name AppName
                              , T.Description
         From TerminalAttrTag T 
              Left Join TerminalAttrApp A   on T.AppID = A.ID 
              Left Join TerminalAttrTab Tab on T.TabID = Tab.ID     
                 Where T.AppID = {0} or T.AppID = 1 
                               Order by T.TabID, T.SeqNo
                   ";
 
strSQL = String.Format(strSQL, AppID);
 
myRepeater.DataSource = bl.GetDataSet(ConnectionString, strSQL);
myRepeater.DataBind();


In screen, it shows:

Terminal Tab    Attributes    Values

Host Config     Host Name     (Textbox)
Host Config     Host IP       (Textbox)
Host Config     Timeout       (Textbox)


I can input below info:

Terminal Tab    Attributes    Values

Host Config     Host Name     Host Main
Host Config     Host IP       172.1.1.1
Host Config     Timeout       30


Now I want to be able to click "Add" button to input below record (2nd records).

Terminal Tab    Attributes    Values

Host Config     Host Name     Host Backup
Host Config     Host IP       172.2.2.2
Host Config     Timeout       50


I am thinking to use DetailsView but in the end I give up due to the dynamic generated textbox.

1. Please enlight me how I can add code in 'Add' button to insert records. Or which part of code need to be fixed or rewrite? And please advise the suitable way to handle this.

2. After problem of add/delete/update records solved, please enlight me how to loop through the records. I need to save all records to database or xml files.

Thank you for your patient.
Questionlive update Pin
Subin Mavunkal3-Jan-13 2:23
Subin Mavunkal3-Jan-13 2:23 
AnswerRe: live update Pin
Keith Barrow3-Jan-13 2:46
professionalKeith Barrow3-Jan-13 2:46 
AnswerRe: live update Pin
Rahul Rajat Singh3-Jan-13 22:04
professionalRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database Pin
Jassim Rahma1-Jan-13 8:32
Jassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? Pin
Jassim Rahma31-Dec-12 23:58
Jassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? Pin
Rahul Rajat Singh3-Jan-13 21:51
professionalRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pin
Deflinek8-Jan-13 2:55
Deflinek8-Jan-13 2:55 
QuestionSlideShow Control Pin
cdpsource31-Dec-12 1:19
cdpsource31-Dec-12 1:19 
AnswerRe: SlideShow Control Pin
jkirkerx31-Dec-12 10:23
professionaljkirkerx31-Dec-12 10:23 
GeneralRe: SlideShow Control Pin
cdpsource31-Dec-12 23:41
cdpsource31-Dec-12 23:41 
AnswerRe: SlideShow Control Pin
jkirkerx1-Jan-13 10:31
professionaljkirkerx1-Jan-13 10:31 
GeneralRe: SlideShow Control Pin
AmitGajjar1-Jan-13 6:41
professionalAmitGajjar1-Jan-13 6:41 
GeneralRe: SlideShow Control Pin
cdpsource1-Jan-13 9:35
cdpsource1-Jan-13 9:35 
Questioni hv registerd in free web hostin website and i create an empty website... Pin
syedkhaleel30-Dec-12 23:24
syedkhaleel30-Dec-12 23:24 
AnswerRe: i hv registerd in free web hostin website and i create an empty website... Pin
_Amy31-Dec-12 17:47
professional_Amy31-Dec-12 17:47 
AnswerRe: i hv registerd in free web hostin website and i create an empty website... Pin
AmitGajjar1-Jan-13 6:43
professionalAmitGajjar1-Jan-13 6:43 
Questionregistration form Pin
khusali30-Dec-12 21:39
khusali30-Dec-12 21:39 

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.