I have two usercontoles,one is "Agentsearch" and the other is "agentList" (a listview of agent search result).I placed Agentsearch usercontrole in home page.I want to open the agent list in another page called 'Aglist.aspx'' when I click search button from home page, this page containing my second usercontrole "agentList"
Protected Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click Server.Transfer("Aglist.aspx?Country=" & dlsCountry.SelectedValue & "&City=" & txtCity.Text & "&Address=" & txtBranch.Text) End Sub
Ok - But I think the only issue in this case is the path reference is wrong.
But since I don't know where the files in your project is placed it's hard to figure out what is missing from the path :) Are the user controls placed in the same directory?
I suppose you have placed both User controls inside the /usercontrols dictionary? But are they both in the same subfolder or do they have unique subfolders?
As Jivan writes all you perhaps need to do is adding the ~in front of the path - That won't help however if something is missing from the path though.
Ok, but it seems you're spelling the name of the Aglist.ascx control wrong? Should'nt it be Agentlist.ascx? At least that's what the name is in the screendump you posted.
Hai Jan, The path is showing here Aglist.aspx but when review that page it shows path 1080.aspx,then I changed the path Aglist.aspx to 1080.aspx,But no luck..!
Ok...hmm, and if you click the url does the page then exist or does it return a 404 page?
I just looked over your code again and I noticed that the forward slash is missing where you're trying to call the page. What happens if you add a forward slash so it looks like this:
Protected Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
Server.Transfer("Aglist.aspx?Country=" & dlsCountry.SelectedValue & "&City=" & txtCity.Text & "&Address=" & txtBranch.Text)
End Sub
UserContole link not working
Hai,
I am using umbraco v6.1.6, in my project I have one usercontrole which links to another usercontrole in another page.
When I click the submit button from first user controle it shows an error
The file '/Aglist.aspx' does not exist.
Please help me..
Hi Shafeeq
Where is the /Aglist.aspx file placed on your disk? And where is the usercontrol from, which you're trying to call this file placed?
/Jan
try using "
~
/Your usercontrol file path`"Dear Jan Skovgaard,
I have two usercontoles,one is "Agentsearch" and the other is "agentList" (a listview of agent search result).I placed Agentsearch usercontrole in home page.I want to open the agent list in another page called 'Aglist.aspx'' when I click search button from home page, this page containing my second usercontrole "agentList"
Protected Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
Server.Transfer("Aglist.aspx?Country=" & dlsCountry.SelectedValue & "&City=" & txtCity.Text & "&Address=" & txtBranch.Text)
End Sub
regards,
Shafeeq
Hi Shafeeq
Ok - But I think the only issue in this case is the path reference is wrong.
But since I don't know where the files in your project is placed it's hard to figure out what is missing from the path :) Are the user controls placed in the same directory?
I suppose you have placed both User controls inside the /usercontrols dictionary? But are they both in the same subfolder or do they have unique subfolders?
As Jivan writes all you perhaps need to do is adding the ~in front of the path - That won't help however if something is missing from the path though.
/Jan
Hai,
I have placed both user controle in same folder named "usercontrols "..
Please see the screenshot.
Hi Shafeeq
Ok, but it seems you're spelling the name of the Aglist.ascx control wrong? Should'nt it be Agentlist.ascx? At least that's what the name is in the screendump you posted.
So either this
~/Agentlist.ascx
or
~/usercontrols/Agentlist.ascx
Should work.
/Jan
Hi jan,
I am not calling the user controle Agentlist.ascx but I am calling another content page "Aglist.aspx" which contains the usercontrole Agentlist.ascx.
regards..
Shafeeq
Hi Shafeeq
Ah yes, sorry.
But the Aglist.aspx - Where in your Umbraco tree is it located? If you browse the node from within Umbraco what is the path then?
/Jan
Hai Jan,
The path is showing here Aglist.aspx but when review that page it shows path 1080.aspx,then I changed the path Aglist.aspx to 1080.aspx,But no luck..!
Hi Shafeeq
Ok...hmm, and if you click the url does the page then exist or does it return a 404 page?
I just looked over your code again and I noticed that the forward slash is missing where you're trying to call the page. What happens if you add a forward slash so it looks like this:
/Jan
is working on a reply...