Click here to Skip to main content
15,888,984 members
Home / Discussions / Web Development
   

Web Development

 
QuestionHow do I insert dropdown Text, not the value, into the database? Pin
samflex17-Nov-17 9:58
samflex17-Nov-17 9:58 
AnswerRe: How do I insert dropdown Text, not the value, into the database? Pin
W Balboos, GHB6-Dec-17 7:27
W Balboos, GHB6-Dec-17 7:27 
GeneralMessage Closed Pin
24-Jan-19 11:19
Sarah George24-Jan-19 11:19 
GeneralRe: How do I insert dropdown Text, not the value, into the database? Pin
W Balboos, GHB25-Jan-19 1:14
W Balboos, GHB25-Jan-19 1:14 
GeneralRe: How do I insert dropdown Text, not the value, into the database? Pin
Richard Deeming25-Jan-19 2:33
mveRichard Deeming25-Jan-19 2:33 
QuestionOne Step Forward, Two Steps Back - Can't create controller using scaffolding Pin
#realJSOP10-Nov-17 2:04
mve#realJSOP10-Nov-17 2:04 
AnswerRe: One Step Forward, Two Steps Back - Can't create controller using scaffolding Pin
#realJSOP11-Nov-17 11:16
mve#realJSOP11-Nov-17 11:16 
QuestionSys.WebForms.Res is undefined when javascript executed inside updatepanel Pin
Claudio Trenca8-Nov-17 4:38
professionalClaudio Trenca8-Nov-17 4:38 
Hi everyone, I have a bootstrap tabs inside an updatepanel, i put in a javascript to keep the status of the tab after postback but this causes the following error on every callback:
Sys.WebForms.Res is undefined


ASP.NET
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                <ContentTemplate>
                                    <div id="Tabs" role="tabpanel">
                                        <div class="row row-text">
                                            <div class="col-md-4">
                                                <p class="h5">
                                                    search
                                                    Effettua Ricerca per:
                                                </p>
                                            </div>
                                            <div class="col-md-8 flex">
                                                <ul class="nav nav-tabs" role="tablist">
                                                    <li role="presentation" class="active"><a href="#rapida" aria-controls="home" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'rapida';">Ricerca rapida</a></li>
                                                    <li role="presentation"><a href="#tecnica" aria-controls="profile" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'tecnica';">Ricerca tecnica</a></li>
                                                    <li role="presentation"><a href="#veicolo" aria-controls="messages" role="tab" data-toggle="tab" class="btn" onclick="javascript: document.getElementById('TabName').value = 'veicolo';">Ricerca veicolo</a></li>
                                                </ul>
                                            </div>
                                        </div>
                                        <div class="tab-content">
                                            <div role="tabpanel" class="tab-pane fade in active" id="rapida">
                                                <div class="row">
                                                    <div class="col-md-11">
                                                        <asp:TextBox ID="SearchText" runat="server" CssClass="form-control"></asp:TextBox>
                                                    </div>
                                                    <div class="col-md-1 no-padding-l">
                                                        <asp:Button ID="SearchTextStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div role="tabpanel" class="tab-pane fade" id="tecnica">
                                                <div class="row">
                                                    <div class="col-md-11">
                                                        <asp:DropDownList ID="SearchCategory" class="form-control" runat="server"></asp:DropDownList>
                                                    </div>
                                                    <div class="col-md-1 no-padding-l">
                                                        <asp:Button ID="SearchCategoryStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
                                                    </div>
                                                </div>
                                            </div>
                                            <div role="tabpanel" class="tab-pane fade" id="veicolo">
                                                <div class="row">
                                                    <div class="col-md-11">

                                                        <div class="col-md-6">
                                                            <asp:DropDownList ID="SearchBrand" runat="server" CssClass="form-control" AutoPostBack="true" EnableViewState="true"></asp:DropDownList>
                                                        </div>
                                                        <div class="col-md-6 no-padding-l">
                                                            <asp:DropDownList ID="SearchModel" runat="server" CssClass="form-control"></asp:DropDownList>
                                                        </div>
                                                    </div>
                                                    <div class="col-md-1 no-padding-l">
                                                        <asp:Button ID="SearchModelStart" runat="server" CssClass="btn btn-first-color btn-first-color--block" Text="Cerca" />
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <asp:HiddenField ID="TabName" runat="server" ClientIDMode="Static" />
                                </ContentTemplate>
                            </asp:UpdatePanel>
<script type="text/javascript">
                                $(function () {
                                    SetTabs();
                                });
                                var prm = Sys.WebForms.PageRequestManager.getInstance();
                                if (prm != null) {
                                    prm.add_endRequest(function (sender, e) {
                                        if (sender._postBackSettings.panelsToUpdate != null) {
                                            SetTabs();
                                        }
                                    });
                                };
                                function SetTabs() {
                                    var tabName = $("[id*=TabName]").val() != "" ? $("[id*=TabName]").val() : "personal";
                                    $('#Tabs a[href="#' + tabName + '"]').tab('show');
                                    $("#Tabs a").click(function () {
                                        $("[id*=TabName]").val($(this).attr("href").replace("#", ""));
                                    });
                                };
                            </script>


in codebehind :

VB
If Me.IsPostBack Then
    TabName.Value = Request.Form(TabName.UniqueID)
End If


modified 8-Nov-17 11:51am.

QuestionMVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 1:59
mve#realJSOP7-Nov-17 1:59 
AnswerRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:22
mveRichard Deeming7-Nov-17 2:22 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:39
mve#realJSOP7-Nov-17 2:39 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:45
mveRichard Deeming7-Nov-17 2:45 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:47
mve#realJSOP7-Nov-17 2:47 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 2:53
mveRichard Deeming7-Nov-17 2:53 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 2:59
mve#realJSOP7-Nov-17 2:59 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
Richard Deeming7-Nov-17 3:03
mveRichard Deeming7-Nov-17 3:03 
GeneralRe: MVC5 - Logoff does not work in Chrome Pin
#realJSOP7-Nov-17 3:01
mve#realJSOP7-Nov-17 3:01 
AnswerRe: MVC5 - Logoff does not work in Chrome Pin
aijaj hussain18-Nov-17 20:09
aijaj hussain18-Nov-17 20:09 
QuestionMVC5 checkbox size (RESOLVED - kinda) Pin
#realJSOP1-Nov-17 2:37
mve#realJSOP1-Nov-17 2:37 
AnswerRe: MVC5 checkbox size Pin
Richard Deeming2-Nov-17 5:53
mveRichard Deeming2-Nov-17 5:53 
GeneralRe: MVC5 checkbox size Pin
#realJSOP2-Nov-17 8:06
mve#realJSOP2-Nov-17 8:06 
AnswerRe: MVC5 checkbox size Pin
#realJSOP3-Nov-17 3:50
mve#realJSOP3-Nov-17 3:50 
SuggestionRe: MVC5 checkbox size Pin
Richard Deeming3-Nov-17 5:07
mveRichard Deeming3-Nov-17 5:07 
GeneralRe: MVC5 checkbox size Pin
#realJSOP3-Nov-17 6:09
mve#realJSOP3-Nov-17 6:09 
GeneralRe: MVC5 checkbox size Pin
Richard Deeming3-Nov-17 10:02
mveRichard Deeming3-Nov-17 10:02 

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.