Access asp.net panel dynamically by IdASP.NET Web Site or ASP.NET Web Application?ASP.NET DropDownList.SelectedItem.Valuenon visibile panel not updating with dropdownlist changepopulating a drop down list from 2 columns from databaseDependent dropdowns populated by sql database in ASP.NETControl the visibility of an asp control based on the selected value of a drop down list control in ASP.NET 2.0Jquery: Change contents of <select> tag dynamicallyDatabase Driven Dependant Dynamic DropDownList on ASP.NETfill drop down list from database dynamically in asp.net c#How to add item(s) to a list box from a drop down
Do I have to mention my main character's age?
Adding gears to my grandson's 12" bike
Should I practice til I "get it" or until I'm sick of it?
Why are the phonemes of Tutankhamun's throne name transliterated out of order?
Can "Taking algebraic closure" be made into a functor?
Is it better to merge "often" or only after completion do a big merge of feature branches?
How should I handle a question regarding my regrets during an interview?
Host telling me to cancel my booking in exchange for a discount?
Found old paper shares of Motorola Inc that has since been broken up
Strange LED behavior
What would be the effects of (relatively) widespread precognition on the stock market?
Has Peter Parker ever eaten bugs?
What do Unicorns want?
Would using carbon dioxide as fuel work to reduce the greenhouse effect?
MITM on HTTPS traffic in Kazakhstan 2019
How often should alkaline batteries be checked when they are in a device?
How did pilots avoid thunderstorms and related weather before “reliable” airborne weather radar was introduced on airliners?
Is it better to deliver many low-value stories or few high-value stories?
What is the best word describing the nature of expiring in a short amount of time, connoting "losing public attention"?
Can the caster of Time Stop still use their bonus action or reaction?
Are Linux kernel modules a sort of Linux system paged pool?
Reflect IR beam off reflector instead of emitting straight to TSOP receiver
Recursive search on Node Tree with Linq and Queue
Which dice game has a board with 9x9 squares that has different colors on the diagonals and midway on some edges?
Access asp.net panel dynamically by Id
ASP.NET Web Site or ASP.NET Web Application?ASP.NET DropDownList.SelectedItem.Valuenon visibile panel not updating with dropdownlist changepopulating a drop down list from 2 columns from databaseDependent dropdowns populated by sql database in ASP.NETControl the visibility of an asp control based on the selected value of a drop down list control in ASP.NET 2.0Jquery: Change contents of <select> tag dynamicallyDatabase Driven Dependant Dynamic DropDownList on ASP.NETfill drop down list from database dynamically in asp.net c#How to add item(s) to a list box from a drop down
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have two drop down lists and one panel in my content page. The panel is not visible. What I want to achieve is when I choose the first item in the first drop down list, the second drop down list will change according to my first list's choice. I have done this part by storing the data into the database and retrieving the choices from the database.
Then, when I choose from the second drop down list, I wish to show the panel. I stored the panel name into database already. I can retrieve the panel name from the database, but I'm not sure how to proceed.
How can I get from that string (panel name) to the panel object and set Visible=true?
asp.net webforms
|
show 1 more comment
I have two drop down lists and one panel in my content page. The panel is not visible. What I want to achieve is when I choose the first item in the first drop down list, the second drop down list will change according to my first list's choice. I have done this part by storing the data into the database and retrieving the choices from the database.
Then, when I choose from the second drop down list, I wish to show the panel. I stored the panel name into database already. I can retrieve the panel name from the database, but I'm not sure how to proceed.
How can I get from that string (panel name) to the panel object and set Visible=true?
asp.net webforms
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
Thank you so much it works.
– yxHang
Mar 26 at 8:21
|
show 1 more comment
I have two drop down lists and one panel in my content page. The panel is not visible. What I want to achieve is when I choose the first item in the first drop down list, the second drop down list will change according to my first list's choice. I have done this part by storing the data into the database and retrieving the choices from the database.
Then, when I choose from the second drop down list, I wish to show the panel. I stored the panel name into database already. I can retrieve the panel name from the database, but I'm not sure how to proceed.
How can I get from that string (panel name) to the panel object and set Visible=true?
asp.net webforms
I have two drop down lists and one panel in my content page. The panel is not visible. What I want to achieve is when I choose the first item in the first drop down list, the second drop down list will change according to my first list's choice. I have done this part by storing the data into the database and retrieving the choices from the database.
Then, when I choose from the second drop down list, I wish to show the panel. I stored the panel name into database already. I can retrieve the panel name from the database, but I'm not sure how to proceed.
How can I get from that string (panel name) to the panel object and set Visible=true?
asp.net webforms
asp.net webforms
edited Mar 26 at 13:36
Brian
3,4873 gold badges15 silver badges35 bronze badges
3,4873 gold badges15 silver badges35 bronze badges
asked Mar 26 at 7:10
yxHangyxHang
31 bronze badge
31 bronze badge
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
Thank you so much it works.
– yxHang
Mar 26 at 8:21
|
show 1 more comment
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
Thank you so much it works.
– yxHang
Mar 26 at 8:21
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
Thank you so much it works.
– yxHang
Mar 26 at 8:21
Thank you so much it works.
– yxHang
Mar 26 at 8:21
|
show 1 more comment
1 Answer
1
active
oldest
votes
put the panel in other asp.net panel with id "pnlParent"
or div with runat="server"
then in your code behind try :
Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351559%2faccess-asp-net-panel-dynamically-by-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
put the panel in other asp.net panel with id "pnlParent"
or div with runat="server"
then in your code behind try :
Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id);
add a comment |
put the panel in other asp.net panel with id "pnlParent"
or div with runat="server"
then in your code behind try :
Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id);
add a comment |
put the panel in other asp.net panel with id "pnlParent"
or div with runat="server"
then in your code behind try :
Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id);
put the panel in other asp.net panel with id "pnlParent"
or div with runat="server"
then in your code behind try :
Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id);
answered Mar 26 at 11:58
Mohammad AlghanemMohammad Alghanem
3913 silver badges18 bronze badges
3913 silver badges18 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55351559%2faccess-asp-net-panel-dynamically-by-id%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I hope I understand you fine, did you try do it from code behind ? pnlId.Visible = true
– Mohammad Alghanem
Mar 26 at 7:52
Maybe my explanation is worst. Procedure will be like this. Choose dropdownlist 1>dropdownlist 2>retrieve panel ID from database based on dropdownlist 1's choice and dropdownlist 2's choices > find that panel using the ID and set its visible to true. Step 1 to 3 is OK but I stuck at step 4. I just don't want hard code it..
– yxHang
Mar 26 at 8:01
Yes, so you want to access the panel by dynamic id
– Mohammad Alghanem
Mar 26 at 8:03
put the panel in other asp.net panel with id "pnlParent" or div with runat="server" then in your code behind try Panel pnl=(Panel)pnlParent.FindControl(your_dynamic_id); please try and let me know
– Mohammad Alghanem
Mar 26 at 8:04
Thank you so much it works.
– yxHang
Mar 26 at 8:21