form submittion fails inside cms template
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
form submittion fails inside cms template

 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server
Author Message
drazic19
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: form submittion fails inside cms template Reply with quote

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_search%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
Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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...
Quote:
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_search%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
Back to top
drazic19
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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:

Quote:
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_search%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


Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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...
Quote:
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...
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_search%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


Back to top
drazic19
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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:

Quote:
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...
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...
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_search%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





Back to top
Stefan [MSFT]
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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...
Quote:
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...
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...
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_search%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





Back to top
drazic19
Guest





Posted: Tue Oct 25, 2005 12:50 pm    Post subject: Re: form submittion fails inside cms template Reply with quote

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:

Quote:
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...
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...
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...
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_search%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








Back to top
 
Post new topic   Reply to topic    Windows Server Forum Index -> CMS Server All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB