Click here to Skip to main content
16,020,669 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: SelectedIndexChanged for DropDown not fired when first item selected Pin
Ron Nicholson17-Nov-23 7:57
professionalRon Nicholson17-Nov-23 7:57 
GeneralRe: SelectedIndexChanged for DropDown not fired when first item selected Pin
DalTXColtsFan17-Nov-23 8:03
DalTXColtsFan17-Nov-23 8:03 
GeneralRe: SelectedIndexChanged for DropDown not fired when first item selected Pin
Andre Oosthuizen18-Nov-23 7:27
mveAndre Oosthuizen18-Nov-23 7:27 
SuggestionRe: SelectedIndexChanged for DropDown not fired when first item selected Pin
Richard Deeming19-Nov-23 21:56
mveRichard Deeming19-Nov-23 21:56 
QuestionDumb it down for one who's basically a beginner Pin
DalTXColtsFan15-Nov-23 5:31
DalTXColtsFan15-Nov-23 5:31 
AnswerRe: Dumb it down for one who's basically a beginner Pin
Andre Oosthuizen15-Nov-23 7:25
mveAndre Oosthuizen15-Nov-23 7:25 
GeneralRe: Dumb it down for one who's basically a beginner Pin
DalTXColtsFan15-Nov-23 11:48
DalTXColtsFan15-Nov-23 11:48 
GeneralRe: Dumb it down for one who's basically a beginner Pin
Andre Oosthuizen16-Nov-23 5:36
mveAndre Oosthuizen16-Nov-23 5:36 
Yes, the 'Page_Load' event is triggered on every request to the page, including postbacks. This means that any code within the 'Page_Load' method will execute during each page load, whether it's an initial request or a postback.

You can try and use the 'SelectedIndexChanged' event of your Category dropdown 'ddlCategory' to dynamically populate the 'SubCategory' dropdown named 'ddlSubCategory'' based on the selected value of Category, similar to -

C#
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        //Populate Category dropdown during the initial load...
        ddlCategory.Items.Add("FirstCat");
        ddlCategory.Items.Add("SecondCat");
        ddlCategory_SelectedIndexChanged(sender, e); //Initial population of your SubCategory dropdown...
    }
    //You can optionally handle postback-specific logic here if needed...
}

protected void ddlCategory_SelectedIndexChanged(object sender, EventArgs e)
{
    //Populate SubCategory dropdown based on your selected value of Category...
    string selectedCategory = ddlCategory.SelectedValue;

    //Add some logic to fetch and populate SubCategory items based on the selectedCategory...

    //Logic might be something like this... -
    ddlSubCategory.Items.Clear(); //Clear existing items...
    if (selectedCategory == "FirstCat")
    {
        ddlSubCategory.Items.Add("SubCat1A");
        ddlSubCategory.Items.Add("SubCat1B");
    }
    else if (selectedCategory == "SecondCat")
    {
        ddlSubCategory.Items.Add("SubCat2A");
        ddlSubCategory.Items.Add("SubCat2B");
    }
    //Add more conditions here as you see fit...
}

Questioncan't build blazor library in azure pipeline Pin
Super Lloyd6-Sep-23 17:08
Super Lloyd6-Sep-23 17:08 
AnswerRe: can't build blazor library in azure pipeline Pin
Super Lloyd6-Sep-23 18:27
Super Lloyd6-Sep-23 18:27 
QuestionBlazor component debugging Pin
Super Lloyd23-Aug-23 14:16
Super Lloyd23-Aug-23 14:16 
AnswerRe: Blazor component debugging Pin
Super Lloyd24-Aug-23 17:27
Super Lloyd24-Aug-23 17:27 
QuestionHTML SELECT CONTROL WITH RUNAT="SERVER Pin
tchia_k30-Jul-23 3:53
professionaltchia_k30-Jul-23 3:53 
AnswerRe: HTML SELECT CONTROL WITH RUNAT="SERVER Pin
Richard Deeming30-Jul-23 22:14
mveRichard Deeming30-Jul-23 22:14 
Question"Context.UserIdentifier" of SignalR is always null when I use CustomAuthenticationStateProvider in Blazor Server App Pin
Alex Wright 202221-Jul-23 3:45
Alex Wright 202221-Jul-23 3:45 
SuggestionRe: "Context.UserIdentifier" of SignalR is always null when I use CustomAuthenticationStateProvider in Blazor Server App Pin
Richard Deeming23-Jul-23 23:17
mveRichard Deeming23-Jul-23 23:17 
QuestionIs is possible to import an excel file with hyperlinks? Pin
samflex16-Jul-23 17:25
samflex16-Jul-23 17:25 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan16-Jul-23 21:45
mveRichard MacCutchan16-Jul-23 21:45 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
samflex17-Jul-23 5:26
samflex17-Jul-23 5:26 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan17-Jul-23 5:29
mveRichard MacCutchan17-Jul-23 5:29 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
samflex18-Jul-23 3:43
samflex18-Jul-23 3:43 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
Richard MacCutchan18-Jul-23 4:40
mveRichard MacCutchan18-Jul-23 4:40 
GeneralRe: Is is possible to import an excel file with hyperlinks? Pin
RedDk18-Jul-23 7:19
RedDk18-Jul-23 7:19 
AnswerRe: Is is possible to import an excel file with hyperlinks? Pin
Andre Oosthuizen16-Jul-23 23:59
mveAndre Oosthuizen16-Jul-23 23:59 
AnswerRe: Is is possible to import an excel file with hyperlinks? Pin
Richard Andrew x6424-Jul-23 3:19
professionalRichard Andrew x6424-Jul-23 3:19 

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.