Dynamic link btn
-
HI, I Created link button dynamically. When I click the link button it ill display the corresponding details which i stored in database. How to do that? Thanks in advance
-
HI, I Created link button dynamically. When I click the link button it ill display the corresponding details which i stored in database. How to do that? Thanks in advance
Muthunagai.A wrote:
When I click the link button it ill display the corresponding details which i stored in database.
You need to attach click event for that link button.
-
Muthunagai.A wrote:
When I click the link button it ill display the corresponding details which i stored in database.
You need to attach click event for that link button.
The List of Question and answers are stored in Database. Questions are all in link button. When i click the Question then only the answer will display. Final output like this Q: 1234? ---> link button A: answer Can u give me any idea? or sample? how to do this?
-
The List of Question and answers are stored in Database. Questions are all in link button. When i click the Question then only the answer will display. Final output like this Q: 1234? ---> link button A: answer Can u give me any idea? or sample? how to do this?
Are you using
Datagrid
to show questions ? If yes you can make usebutton column
. Make button type aslink button
, which will be rendered as HTML Link. Setcommand name
property of button column. When user clicks link button, ASP.NET will fireItemCommand
event. You need to check the command inside this event to ensure that it is coming from your link button. Now get question id from the grid bound columns and query to database with this id for getting relevant answers.
-
Are you using
Datagrid
to show questions ? If yes you can make usebutton column
. Make button type aslink button
, which will be rendered as HTML Link. Setcommand name
property of button column. When user clicks link button, ASP.NET will fireItemCommand
event. You need to check the command inside this event to ensure that it is coming from your link button. Now get question id from the grid bound columns and query to database with this id for getting relevant answers.
:laugh:;);P:^):sigh::confused:
-
Are you using
Datagrid
to show questions ? If yes you can make usebutton column
. Make button type aslink button
, which will be rendered as HTML Link. Setcommand name
property of button column. When user clicks link button, ASP.NET will fireItemCommand
event. You need to check the command inside this event to ensure that it is coming from your link button. Now get question id from the grid bound columns and query to database with this id for getting relevant answers.
No, I'm not using the Datagrid. I'm using Panel to show the result. Sorrry, now tell me? how to do that?
-
HI, I Created link button dynamically. When I click the link button it ill display the corresponding details which i stored in database. How to do that? Thanks in advance
1 .Take datagrid. 2. Take LinkButton in ItemTemplate and bind it with Question field. 3 take DIV and apply style display:none property 3. Take Label Control in div tag and Bind it with Answer field 4. Now call javascript function on LinkButton to display or hide Answer field Best Regard Pathan
---------------------------------------------------
-
HI, I Created link button dynamically. When I click the link button it ill display the corresponding details which i stored in database. How to do that? Thanks in advance
The trick is, if you dynamically create any controls, they need to be created before page_load, so that their viewstate is restored, and you get their events and values back.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
The trick is, if you dynamically create any controls, they need to be created before page_load, so that their viewstate is restored, and you get their events and values back.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Thank you. But I want to do it in a button click event.Is it possible? I have to edit the question & answer and store it to the database. Thanks in advance
-
Thank you. But I want to do it in a button click event.Is it possible? I have to edit the question & answer and store it to the database. Thanks in advance
It doesn't matter where you create it the first time, so long as it's recreated before page_load on postback.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )