Click here to Skip to main content
12,394,629 members (75,804 online)
   

ASP.NET

 
GeneralRe: Browser Compatibilty Pin
Sandeep Mewara17-Jan-13 23:50
mvpSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pin
ravitejapammi23-Jan-13 23:08
memberravitejapammi23-Jan-13 23:08 
QuestionHow can I delete a Column of XLSX file with EPPlus in web application? Pin
cawboy_iran6-Jan-13 20:00
membercawboy_iran6-Jan-13 20:00 
AnswerRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
Sandeep Mewara6-Jan-13 21:26
mvpSandeep Mewara6-Jan-13 21:26 
GeneralRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
cawboy_iran7-Jan-13 2:48
membercawboy_iran7-Jan-13 2:48 
QuestionWoW Slider now showing the image Pin
Jassim Rahma5-Jan-13 8:06
memberJassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image Pin
Sandeep Mewara5-Jan-13 20:09
mvpSandeep 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
memberamsedky5-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
mvpSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pin
ashraf almashhari4-Jan-13 21:46
memberashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net Pin
Sandeep Mewara4-Jan-13 22:14
mvpSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net Pin
Manjunath Hegde4-Jan-13 0:41
memberManjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net Pin
Rahul Rajat Singh4-Jan-13 1:04
memberRahul 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
memberguodl3-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: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:

/// <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:

           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
memberSubin Mavunkal3-Jan-13 2:23 
AnswerRe: live update Pin
Keith Barrow3-Jan-13 2:46
mentorKeith Barrow3-Jan-13 2:46 
AnswerRe: live update Pin
Rahul Rajat Singh3-Jan-13 22:04
memberRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database Pin
Jassim Rahma1-Jan-13 8:32
memberJassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? Pin
Jassim Rahma31-Dec-12 23:58
memberJassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? Pin
Rahul Rajat Singh3-Jan-13 21:51
memberRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pin
deflinek8-Jan-13 2:55
memberdeflinek8-Jan-13 2:55 
QuestionSlideShow Control Pin
cdpsource31-Dec-12 1:19
membercdpsource31-Dec-12 1:19 
AnswerRe: SlideShow Control Pin
jkirkerx31-Dec-12 10:23
memberjkirkerx31-Dec-12 10:23 
GeneralRe: SlideShow Control Pin
cdpsource31-Dec-12 23:41
membercdpsource31-Dec-12 23:41 
AnswerRe: SlideShow Control Pin
jkirkerx1-Jan-13 10:31
memberjkirkerx1-Jan-13 10:31 
GeneralRe: SlideShow Control Pin
@AmitGajjar1-Jan-13 6:41
member@AmitGajjar1-Jan-13 6:41 
GeneralRe: SlideShow Control Pin
cdpsource1-Jan-13 9:35
membercdpsource1-Jan-13 9:35 
Questioni hv registerd in free web hostin website and i create an empty website... Pin
syedkhaleel30-Dec-12 23:24
membersyedkhaleel30-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
member_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
member@AmitGajjar1-Jan-13 6:43 
Questionregistration form Pin
khusali30-Dec-12 21:39
memberkhusali30-Dec-12 21:39 
AnswerRe: registration form Pin
_Amy31-Dec-12 17:45
member_Amy31-Dec-12 17:45 
AnswerRe: registration form Pin
@AmitGajjar1-Jan-13 6:55
member@AmitGajjar1-Jan-13 6:55 
AnswerRe: registration form Pin
Rahul Rajat Singh3-Jan-13 21:53
memberRahul Rajat Singh3-Jan-13 21:53 
QuestionSlider control in SSRS Pin
Sanjeewan9929-Dec-12 18:28
memberSanjeewan9929-Dec-12 18:28 
Questionadvertising platform...? Pin
Jassim Rahma29-Dec-12 9:24
memberJassim Rahma29-Dec-12 9:24 
GeneralRe: advertising platform...? Pin
jkirkerx30-Dec-12 13:38
memberjkirkerx30-Dec-12 13:38 
QuestionFile Upload Component...? Pin
Jassim Rahma28-Dec-12 9:44
memberJassim Rahma28-Dec-12 9:44 
AnswerRe: File Upload Component...? Pin
Sandeep Mewara28-Dec-12 21:14
mvpSandeep Mewara28-Dec-12 21:14 
QuestionCan we make a application to update FB status? Pin
anubhaw.gupta28-Dec-12 6:18
memberanubhaw.gupta28-Dec-12 6:18 
AnswerRe: Can we make a application to update FB status? Pin
Sandeep Mewara28-Dec-12 21:10
mvpSandeep Mewara28-Dec-12 21:10 
QuestionLive Streaming Broadcasting Pin
AhmedYehiaK28-Dec-12 3:19
memberAhmedYehiaK28-Dec-12 3:19 
AnswerRe: Live Streaming Broadcasting Pin
Sandeep Mewara28-Dec-12 21:05
mvpSandeep Mewara28-Dec-12 21:05 
GeneralRe: Live Streaming Broadcasting Pin
AhmedYehiaK29-Dec-12 0:03
memberAhmedYehiaK29-Dec-12 0:03 
QuestionHow to show the previous selected checked box in previous page in asp.net Pin
Arun kumar Gautam28-Dec-12 0:18
memberArun kumar Gautam28-Dec-12 0:18 
AnswerRe: How to show the previous selected checked box in previous page in asp.net Pin
Sandeep Mewara28-Dec-12 21:17
mvpSandeep Mewara28-Dec-12 21:17 
GeneralRe: How to show the previous selected checked box in previous page in asp.net Pin
Arun kumar Gautam29-Dec-12 1:16
memberArun kumar Gautam29-Dec-12 1:16 
GeneralRe: How to show the previous selected checked box in previous page in asp.net Pin
anubhaw.gupta29-Dec-12 7:04
memberanubhaw.gupta29-Dec-12 7:04 
QuestionMicrosoft Sync Framework for File (Client) and SQL Server Database (Server) synchronization Pin
Ajeet mittal27-Dec-12 17:27
memberAjeet mittal27-Dec-12 17:27 
QuestionWhat is the web.config for the <smtp> ? Pin
alihusain_7727-Dec-12 9:38
memberalihusain_7727-Dec-12 9:38 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 22 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid