November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
What kind of parameters do you want to pass in?
If it's a query string you can simply use:
<a target="heading" href="@Url.ContentUrl(Model.BlogLink)?boo=foo"></a>
Hi Dejan Caric
Thanks for your response, i want to pass the int,string type of parameters not query string.
Thanks,
Karttheek
What exactly are you trying to solve? You have ContentLink and UrlLink helpers that allow you to pass in IDictionary<string, object> for htmlAttributes, but I guess that's not what you're looking for.
I'm not sure if this is the problem you're referring to, but you are closing your a-tag immediately after you open it, and then adding the heading. It should be like this:
<a target="heading" href="@Url.ContentUrl(Model.BlogLink)">@i.MainHeading</a>
I want to pass the MainHeading(i.e:-@i.MainHeading) value as parameter to action methos its string type.
Thanks,
Ramkee.G
Hi @Murtaza ali,
i also trying with @Url.Action() to navigate, but i get an error. you can see the below code.
Code:-
<a href="@Url.Action("Index", "Post")" > @i.MainHeading</a> and i using
<a href="@Html.Action("Index", "Post")">@i.MainHeading</a>
but this actions are not working
PostController:-
public class PostController : PageController<Post>
{
public ActionResult Index(Post currentPage)
{
return View();
}
}
Error:-
IIS 10.0 Detailed Error - 404.0 - Not Found
Hi Guys,
Using Url property how can navigate to another page and i also want to pass the parameter along with navigation.
BlogPage.cs:-
[ContentType(DisplayName = "BlogPage", GUID = "b50836e3-9efd-4a4d-b0ee-7ecad52a684d", Description = "")]
public class BlogPage : PageData
{
[CultureSpecific]
[Display(
Name = "Blog Link",
Description = "",
GroupName = SystemTabNames.Content,
Order = 5)]
public virtual Url BlogLink { get; set; }
[CultureSpecific]
[ReadOnly(false)]
[Display(
Name = "Main Heading",
Description = "",
GroupName = SystemTabNames.Content,
Order = 2)]
public virtual string MainHeading { get; set; }
}
.Cshtml
@foreach (var i in ViewBag.ss)
{
@i.MainHeading
}
i have written the above code, but i did not pass parameters to it
Thanks,
Kartheek