asp.netvb.netasp.net-mvc-4runatserverrunat

What the meaning of runat="client" (If it exist)


I'm writing an ASPx page in my MVC project with my VisualStudio 2017 with ReSharper installed when, writing a runat server part, ReSharper gave me two options in the runat attribute: server and client. What is the meaning of runat="client"? Is that an error of ReSharper?


Solution

  • Hi I don't know anything about ReShaper, but in ASP the option 'runat="server"' is used for have access in the code behind (CS/VB) like for example:

    *ASP page
    <asp:Label id"label" runat="server"></asp:Label>
    
    CS page
    label.Text = "Here you can change label text";
    
    VB page
    label.Text = "Here you can change label text"
    

    The option 'runat="client"' that you are talking doesn't exist in asp.net, i have search for that and it exist in other languanges but not in asp.

    Hope it's usefull!

    Regards