|
Home > Archive > Microsoft Content Management Server > October 2005 > form submittion fails inside cms template
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
form submittion fails inside cms template
|
|
| drazic19 2005-10-25, 7:48 am |
| Hi,
I've been working on a complete form that runs a search and displays the
results. The form and results work fine in a standalone aspx page however
when i move it to a cms template the form fails to work and when i submit the
form the page changes from the .htm page to the template file i.e.
templates/search/aspx?NRMODE=Published& NRORIGINALURL=%2fnearyou2%2fevents_searc
h%2ehtm&NRNODEGU etc
This must be causing the form not to work, whats the solution to this sort
of problem, can't imagine its not a common one.
Thanks for any help,
Michael
| |
| Stefan [MSFT] 2005-10-25, 7:48 am |
| Hi Michael,
the URL change is as expected and not the reason for the problem.
Actually you are not allowed to add <form...> tags to an ASPX page. So I
hope that your search form is actually a ASP.NET user control and not really
a form.
Please confirm.
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:CE868119-1162-42FD-9004-2EB522A407EB@microsoft.com...
> Hi,
>
> I've been working on a complete form that runs a search and displays the
> results. The form and results work fine in a standalone aspx page however
> when i move it to a cms template the form fails to work and when i submit
> the
> form the page changes from the .htm page to the template file i.e.
> templates/search/aspx?NRMODE=Published& NRORIGINALURL=%2fnearyou2%2fevents_searc
h%2ehtm&NRNODEGU
> etc
>
> This must be causing the form not to work, whats the solution to this sort
> of problem, can't imagine its not a common one.
>
> Thanks for any help,
>
> Michael
| |
| drazic19 2005-10-25, 7:48 am |
| Hi Stefan,
Yes the search is a user control and the only form tags i have on the page
are the default ones next to the body tags.
Michael
"Stefan [MSFT]" wrote:
> Hi Michael,
>
> the URL change is as expected and not the reason for the problem.
> Actually you are not allowed to add <form...> tags to an ASPX page. So I
> hope that your search form is actually a ASP.NET user control and not really
> a form.
> Please confirm.
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> ----------------------
>
>
> "drazic19" <drazic19@discussions.microsoft.com> wrote in message
> news:CE868119-1162-42FD-9004-2EB522A407EB@microsoft.com...
>
>
>
| |
| Stefan [MSFT] 2005-10-25, 7:48 am |
| Hi Michael,
that looks fine. A similar approach works correct on my box.
Do the event of this control fire?
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:9DA54517-96FA-4B63-8312-EEA06AB1CDD8@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> Yes the search is a user control and the only form tags i have on the page
> are the default ones next to the body tags.
>
> Michael
>
> "Stefan [MSFT]" wrote:
>
| |
| drazic19 2005-10-25, 7:48 am |
| Hi Stefan,
Yes it appears that the events do fire, however its just not displaying the
results as it did in the non cms template page.
template page code:
<uc1:events_search id="Events_search1" runat="server"></uc1:events_search>
<!--no of rows header-->
<%response.write(session("HTML"))%>
<!--sorting link buttons server controls-->
<asp:label id="lbl_Sort" runat="server">Sort results by: </asp:label>
<asp:linkbutton id="lnk_BasicSortDate" runat="server">Date</asp:linkbutton>
<asp:label id="lbl_Separator" runat="server"> | </asp:label>
<asp:linkbutton id="lnk_BasicSortRegion"
runat="server">Region/Branch</asp:linkbutton>
<%response.write(session("HTML2"))%>
ascx control: submit button code:
lblTest.Text += "btnSubmitBasic_Click fired<br>"
'fire event to be bubbled to parent page
Session("HTML") = ""
If fnc_Nothing(Me.txt_Keyword.Text) And
Me.cbo_Location1.SelectedIndex = 0 Then
Me.lbl_BasicError.Visible = True
'event seems to be raised even when there is no criteria hence
the session(nocriteria) variable
'so that the search is abandoned in the aspx
Session("NoCriteria") = True
Exit Sub
End If
'check keyword for illegality
Dim bool_IgnoreFail As Boolean = False
If Not fnc_Nothing(Me.txt_Keyword.Text, False) Then
If Len(Me.txt_Keyword.Text) > 7 Then 'its OK all ignored words 7
char or less
GoTo exit_IgnoreCheck
Else
If Len(Me.txt_Keyword.Text) < 2 Then
bool_IgnoreFail = True
GoTo IgnoreFail
End If
Dim dr_Ignore As SqlDataReader
dr_Ignore = fnc_GetDataReader("sp_Ignore_Check", "@Keyword",
Trim(Me.txt_Keyword.Text), "varchar")
If dr_Ignore.HasRows Then
bool_IgnoreFail = True
Else
GoTo exit_IgnoreCheck
End If
dr_Ignore.Close()
End If
End If
IgnoreFail:
If bool_IgnoreFail = True Then
Me.lbl_BasicError.Text = "Keyword either too short or too
common. Please try again"
Me.lbl_BasicError.Visible = True
Session("NoCriteria") = True
Exit Sub
End If
exit_IgnoreCheck:
Dim eArgs As New CommandEventArgs("Basic", "Basic")
'RaiseEvent Basic_Search_Click(Me, eArgs)
RaiseBubbleEvent(Me, eArgs)
"Stefan [MSFT]" wrote:
> Hi Michael,
>
> that looks fine. A similar approach works correct on my box.
> Do the event of this control fire?
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> ----------------------
>
>
> "drazic19" <drazic19@discussions.microsoft.com> wrote in message
> news:9DA54517-96FA-4B63-8312-EEA06AB1CDD8@microsoft.com...
>
>
>
| |
| Stefan [MSFT] 2005-10-25, 7:48 am |
| Hi Michael,
then I would suggest to debug the code and check if the result is correctly
assigned to the result control. What are you using for the results? A label
control?
Cheers,
Stefan
--
This posting is provided "AS IS" with no warranties, and confers no rights
New to MCMS?
Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
----------------------
"drazic19" <drazic19@discussions.microsoft.com> wrote in message
news:A9362B63-AB10-4D5C-8A1B-2FAE202D47ED@microsoft.com...[vbcol=seagreen]
> Hi Stefan,
>
> Yes it appears that the events do fire, however its just not displaying
> the
> results as it did in the non cms template page.
>
> template page code:
> <uc1:events_search id="Events_search1" runat="server"></uc1:events_search>
> <!--no of rows header-->
> <%response.write(session("HTML"))%>
> <!--sorting link buttons server controls-->
> <asp:label id="lbl_Sort" runat="server">Sort results by: </asp:label>
> <asp:linkbutton id="lnk_BasicSortDate"
> runat="server">Date</asp:linkbutton>
> <asp:label id="lbl_Separator" runat="server"> | </asp:label>
> <asp:linkbutton id="lnk_BasicSortRegion"
> runat="server">Region/Branch</asp:linkbutton>
> <%response.write(session("HTML2"))%>
>
> ascx control: submit button code:
>
> lblTest.Text += "btnSubmitBasic_Click fired<br>"
>
> 'fire event to be bubbled to parent page
> Session("HTML") = ""
>
> If fnc_Nothing(Me.txt_Keyword.Text) And
> Me.cbo_Location1.SelectedIndex = 0 Then
>
> Me.lbl_BasicError.Visible = True
> 'event seems to be raised even when there is no criteria hence
> the session(nocriteria) variable
> 'so that the search is abandoned in the aspx
> Session("NoCriteria") = True
> Exit Sub
> End If
>
> 'check keyword for illegality
> Dim bool_IgnoreFail As Boolean = False
> If Not fnc_Nothing(Me.txt_Keyword.Text, False) Then
>
> If Len(Me.txt_Keyword.Text) > 7 Then 'its OK all ignored words
> 7
> char or less
> GoTo exit_IgnoreCheck
> Else
> If Len(Me.txt_Keyword.Text) < 2 Then
> bool_IgnoreFail = True
> GoTo IgnoreFail
> End If
> Dim dr_Ignore As SqlDataReader
> dr_Ignore = fnc_GetDataReader("sp_Ignore_Check",
> "@Keyword",
> Trim(Me.txt_Keyword.Text), "varchar")
> If dr_Ignore.HasRows Then
> bool_IgnoreFail = True
> Else
> GoTo exit_IgnoreCheck
> End If
> dr_Ignore.Close()
> End If
> End If
>
> IgnoreFail:
> If bool_IgnoreFail = True Then
> Me.lbl_BasicError.Text = "Keyword either too short or too
> common. Please try again"
> Me.lbl_BasicError.Visible = True
> Session("NoCriteria") = True
> Exit Sub
> End If
> exit_IgnoreCheck:
> Dim eArgs As New CommandEventArgs("Basic", "Basic")
>
> 'RaiseEvent Basic_Search_Click(Me, eArgs)
> RaiseBubbleEvent(Me, eArgs)
>
> "Stefan [MSFT]" wrote:
>
| |
| drazic19 2005-10-25, 7:48 am |
| The result is looped through and writes a string of html code which is dumped
into the page using a response.write will debug and see what happens, thanks.
Michael
"Stefan [MSFT]" wrote:
> Hi Michael,
>
> then I would suggest to debug the code and check if the result is correctly
> assigned to the result control. What are you using for the results? A label
> control?
>
> Cheers,
> Stefan
>
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
>
> New to MCMS?
> Check out this book: Building Websites Using MCMS: http://tinyurl.com/6zj44
> ----------------------
>
>
> "drazic19" <drazic19@discussions.microsoft.com> wrote in message
> news:A9362B63-AB10-4D5C-8A1B-2FAE202D47ED@microsoft.com...
>
>
>
|
|
|
|
|