Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6349509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:37:51+00:00 2026-05-24T21:37:51+00:00

As written in the title I have problems assigning values to the textbox inside

  • 0

As written in the title I have problems assigning values to the textbox inside a panel. The problem is that a button from gvAsseti doesn’t show the pnlAsset (which has textboxes in it) and doesn’t load the values into the textboxes.

What is strange is that code executes fine and while using debugger I was able to see that correct values are sent to the textboxes, but for some reason they aren’t displayed (all I get are empty textboxes).

Here is the codefront (sorry for the length, you can skip the middle part, it has only textboxes):

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<uc:Firma ID="ucFirma" runat="server"></uc:Firma>
<asp:GridView ID="gvKontakti" runat="server" OnRowCommand="gvKontakti_RowCommand"
    DataKeyNames="idKontakt">
    <Columns>
        <asp:TemplateField>
            <ItemTemplate>
                <asp:Button ID="btnShowAssets" runat="server" CommandArgument='<%# Eval("idKontakt") %>'
                    CommandName="ShowAssets" Text="Prikaži assete" />
                <asp:Button ID="btnAddAsset" runat="server" CommandArgument='<%# Eval("idKontakt") %>'
                    CommandName="AddAsset" Text="Dodaj asset" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:BoundField DataField="idKontakt" HeaderText="ID" Visible="false" />
        <asp:BoundField DataField="Naziv" HeaderText="Naziv" />
    </Columns>
</asp:GridView>
<asp:Panel ID="pnlAsset" runat="server">
    <table>
        <tr>
            <td>
                Naziv:
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtNaziv" runat="server" Width="430px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Kod 1:
            </td>
            <td>
                <asp:TextBox ID="txtKod1" runat="server"></asp:TextBox>
            </td>
            <td>
                Kod 2:
            </td>
            <td>
                <asp:TextBox ID="txtKod2" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Datum isteka garancije:
            </td>
            <td>
                <asp:TextBox ID="txtGarancija" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Lokacija:
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtLokacija" runat="server" TextMode="MultiLine" Width="455px" Height="200px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Opis:
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtOpis" runat="server" TextMode="MultiLine" Width="455px" Height="200px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Aktivna imovina:
            </td>
            <td>
                <asp:CheckBox ID="chkAktivna" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btnSave" runat="server" Text="Spremi" OnClick="btnSave_Click" />
            </td>
        </tr>
    </table>
</asp:Panel>
<asp:UpdatePanel ID="upAsseti" runat="server">
    <ContentTemplate>
        <asp:GridView ID="gvAsseti" runat="server" onrowcommand="gvAsseti_RowCommand">
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Button ID="btnShowAsset" runat="server" CommandArgument='<%# Eval("idAsset") %>'
                            CommandName="ShowAsset" Text="Prikaži asset" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </ContentTemplate>
</asp:UpdatePanel>

And also the codebehind:

        protected void gvAsseti_RowCommand(object sender, GridViewCommandEventArgs e)
    {

        int idFirma = Convert.ToInt32(Request.QueryString["idt"]);
        int idAsset = Convert.ToInt32(e.CommandArgument);

        TicketingSystemEntities db = new TicketingSystemEntities();

        if (e.CommandName=="ShowAsset")
        {
            var asset = (from a in db.Assets
                         where a.idAsset == idAsset
                         select a).SingleOrDefault();

            pnlAsset.Visible = true;

            txtGarancija.Text = asset.DatumGarancije.ToString();
            txtKod1.Text = asset.Kod1;
            txtKod2.Text = asset.Kod2;
            txtLokacija.Text = asset.Lokacija;
            txtNaziv.Text = asset.Naziv;
            txtOpis.Text = asset.Opis;

            if (asset.Aktivan == true)
            {
                chkAktivna.Checked = true;
            }
            else
            {
                chkAktivna.Checked = false;
            }
        }
    }
}

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:37:52+00:00Added an answer on May 24, 2026 at 9:37 pm

    Put the panel inside the updatepanel contenttemplate. As gvAsseti’s inside an updatepanel, therefore it’ll be refreshing the contents of the updatepanel on postback.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The title basically spells it out. What interfaces have you written that makes you
I have written a xml/php document that is pulling from a Magento Commerce database,
I have a problem so strange that I hardly can put an adequate title
I have this fragment that demonstrates the problem: <html> <head> <title>height query demo</title> <script
As I had written in title, I have SQL query, run on Oracle DB,
I'm thinking about the problem in question title: if I have to query for
I'm learning javascript and jquery and have written a very basic script inside my
I have written a loop in wordpress that loops through the post titles and
The Problem I have a very nifty menu Html helper written for WebFormViewEngine views.
I have a problem getting an inputed date (yyyyMMdd) from an HTML form to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.