Click here to Skip to main content
15,922,696 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionasp.net Pin
bipinprem154-Aug-12 22:50
bipinprem154-Aug-12 22:50 
AnswerRe: asp.net Pin
Sandeep Mewara5-Aug-12 1:08
mveSandeep Mewara5-Aug-12 1:08 
QuestionHow to create a customized pop up window in the top of the page if the browser's pop up blocker is enabled Pin
Beniston12054-Aug-12 1:10
Beniston12054-Aug-12 1:10 
AnswerRe: How to create a customized pop up window in the top of the page if the browser's pop up blocker is enabled Pin
Eddy Vluggen4-Aug-12 6:12
professionalEddy Vluggen4-Aug-12 6:12 
AnswerRe: How to create a customized pop up window in the top of the page if the browser's pop up blocker is enabled Pin
Sandeep Mewara4-Aug-12 19:45
mveSandeep Mewara4-Aug-12 19:45 
Questionset watermark for textbox Pin
Jassim Rahma3-Aug-12 12:09
Jassim Rahma3-Aug-12 12:09 
AnswerRe: set watermark for textbox Pin
R. Giskard Reventlov3-Aug-12 12:20
R. Giskard Reventlov3-Aug-12 12:20 
Questionproblem with dynamic displaying data Pin
samio073-Aug-12 4:25
samio073-Aug-12 4:25 
XML
my problem is how to display selected item and a content of textbox in a gridview after a submit button dynamically (i will repeat more than 1 time) and so automatically the submit button will insert data in DB(entity framework)
the DropDownList1 is populated from db
to explain more this is my page :

<fieldset id="Item2">
<legend> Item Information</legend>
<br />
<br />
<center>
<table>
<tr>
<td>
<asp:Label ID="lblIemName" runat="server" >Item Name</asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true"
        AppendDataBoundItems="true" EnableViewState="true">
<asp:ListItem Value="0">--Select--</asp:ListItem></asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblQuantity" runat="server" >Quantité</asp:Label>
</td>
<td>
<asp:TextBox ID="txtQuantity" runat="server" Width="62px"></asp:TextBox></td>
<td><asp:ImageButton ID="btnAddItem" runat="server" Height="20" Width="20" ImageUrl="~/Images/Add.png"  OnClick="btnAddItem12_click"  />
</td>
</tr>
</table>
</center>
<br />
<br />
<center>
<asp:GridView ID="gvPurchasedItem" runat="server" AutoGenerateColumns="False" DataKeyNames="IDItemLinePurchased"
                 BackColor="Aquamarine">
                <Columns>
                    <asp:BoundField HeaderText="CategoryName" ControlStyle-Width="250" DataField="CategoryName">
                        <ControlStyle Width="250px"></ControlStyle>
                    </asp:BoundField>
                    <asp:BoundField HeaderText="ItemName" DataField="ItemName" />
                    <asp:BoundField HeaderText="Quantity" DataField="Quantity" />
                </Columns>
            </asp:GridView>
            </center>
</fieldset>

my behind code is :


protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                Populateddlitem();
            }
        }

void Populateddlitem()
        {
            DropDownList1.DataTextField = "ItemName";
            DropDownList1.DataValueField = "IDItem";
            DropDownList1.DataSource = LogicItem.Instance.GetItems();
            DropDownList1.DataBind();
        }

protected void btnAddItem_click(object sender, ImageClickEventArgs e)
        {
           // insert bloc
            ItemLinePurchased res = null;
            if (ID == 0)
                res = new ItemLinePurchased();
            else res = LogicItemLinePurchased.Instance.GetItemLinePurchasedByID(ID);
            res.Quantity = Convert.ToInt32(txtQuantity10.Text);
            res.IDItem = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            ViewState["ddl"] = DropDownList1.SelectedItem.Value;
            res.IDPurchasesDoc = Convert.ToInt32(ViewState["PurchasesDocid"]);
            res.State = "IsActive";
            LogicItemLinePurchased.Instance.SaveItemLinePurchased(res);
            int aaa = DropDownList1.SelectedIndex;
            int bbb = Convert.ToInt32(Session["ddlState"]);
            ViewState["id"] = res.IDItemLinePurchased;
            //display grid view
            gvPurchasedItem.DataSource = (from ItemLinePurchased in LogicItemLinePurchased.Instance.GetAllItemLinePurchased()
                                          where ItemLinePurchased.IDItemLinePurchased == Convert.ToInt32(ViewState["id"]) && ItemLinePurchased.State == "IsActive"
                                          select new
                                          {
                                              ItemLinePurchased.IDItemLinePurchased,
                                              ItemLinePurchased.Item.Category.CategoryName,
                                              ItemLinePurchased.Item.ItemName,
                                              ItemLinePurchased.Quantity,
                                          }).ToList();
            gvPurchasedItem.DataBind();
        }
any one have a solution to my problem post it and thanks

Questionhow to let Google do this for me? Pin
Jassim Rahma3-Aug-12 1:05
Jassim Rahma3-Aug-12 1:05 
AnswerRe: how to let Google do this for me? Pin
Eddy Vluggen3-Aug-12 2:51
professionalEddy Vluggen3-Aug-12 2:51 
AnswerRe: how to let Google do this for me? Pin
jkirkerx3-Aug-12 9:54
professionaljkirkerx3-Aug-12 9:54 
QuestionI have done login page in asp.net mvc pattern.But,im getting one run time error Pin
rayuduvkr3-Aug-12 0:19
rayuduvkr3-Aug-12 0:19 
AnswerRe: I have done login page in asp.net mvc pattern.But,im getting one run time error Pin
Pete O'Hanlon3-Aug-12 0:43
mvePete O'Hanlon3-Aug-12 0:43 
AnswerRe: I have done login page in asp.net mvc pattern.But,im getting one run time error Pin
Tarun Mangukiya4-Aug-12 21:38
Tarun Mangukiya4-Aug-12 21:38 
Questionasp.net Pin
Sasikumar.mohan2-Aug-12 19:56
Sasikumar.mohan2-Aug-12 19:56 
AnswerRe: asp.net Pin
Sandeep Mewara2-Aug-12 21:23
mveSandeep Mewara2-Aug-12 21:23 
QuestionClose the ChannelFactory connection Pin
indian1432-Aug-12 6:01
indian1432-Aug-12 6:01 
AnswerRe: Close the ChannelFactory connection Pin
jkirkerx3-Aug-12 11:09
professionaljkirkerx3-Aug-12 11:09 
GeneralRe: Close the ChannelFactory connection Pin
jkirkerx3-Aug-12 12:23
professionaljkirkerx3-Aug-12 12:23 
GeneralRe: Close the ChannelFactory connection Pin
indian1434-Aug-12 16:59
indian1434-Aug-12 16:59 
GeneralRe: Close the ChannelFactory connection Pin
jkirkerx5-Aug-12 11:00
professionaljkirkerx5-Aug-12 11:00 
Questionperformance tune a 2010 web app Pin
dcof2-Aug-12 4:25
dcof2-Aug-12 4:25 
AnswerRe: performance tune a 2010 web app Pin
jkirkerx3-Aug-12 10:52
professionaljkirkerx3-Aug-12 10:52 
GeneralCreating Composite Controls ASP.NET 4.0 Pin
RookieCoder_NG1-Aug-12 19:12
RookieCoder_NG1-Aug-12 19:12 
GeneralRe: Creating Composite Controls ASP.NET 4.0 Pin
David Mujica2-Aug-12 8:05
David Mujica2-Aug-12 8:05 

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.