Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8429765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:25:39+00:00 2026-06-10T05:25:39+00:00

I am using the Html.BeginForm and passing in a css class as per below:

  • 0

I am using the Html.BeginForm and passing in a css class as per below:

@using (Html.BeginForm("Logon", "Account", FormMethod.Post, new { @class = "form" } ))

that works fine, but I want to add a returnURL querystring parameter after it but that doesn’t seem to work:

@using (Html.BeginForm("Logon", "Account", FormMethod.Post, new { @class = "form", returnUrl = Request.QueryString["ReturnUrl"] }))

how can I add multiple htmlAttributes so that I can tell it my css class and a querystring parameter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:25:40+00:00Added an answer on June 10, 2026 at 5:25 am

    Use the following overload of BeginForm.

    @using (Html.BeginForm("Logon", "Account", 
            new { returnUrl = Request.QueryString["ReturnUrl"] }, FormMethod.Post, 
            new { @class = "form"}))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I dynamically draw checkboxes in my form: @using (Html.BeginForm(Action, Controller, FormMethod.Post, new { id=itemsList}))
The form begins: <% using (Html.BeginForm(Index, recordssbook, FormMethod.Post, new { id = SubmitForm }))
@using (Html.BeginForm(Edit, MyController, FormMethod.Post, new { enctype=multipart/form-data})) { @Html.EditorFor(model => model.Name) <input type=file name=fileUpload
I have this form: @using (Html.BeginForm(Update, MyController, FormMethod.Post, new { id = frmEdit }))
I have the following form: @model Teesa.Models.SearchModel @using (Html.BeginForm(Index, Search, FormMethod.Get, new { id
Here is my controller code and also my View: @using (Html.BeginForm(Create, Product, FormMethod.Post, new
<%using (Html.BeginForm(OrderDevice, ImportXML, FormMethod.Post)) { %> <table id=OrderDevices class=data-table> <tr> <th> DeviceId </th> <th>
I have a partial view: <% using (Html.BeginForm(add, home, FormMethod.Post, new { enctype =
// html <% using (Html.BeginForm(MyAction, MyController, new { id = ViewContext.RouteData.Values[id] }, FormMethod.Post, new
I have a form like below:- <% using ( Html.BeginForm(search, home, FormMethod.Get) ) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.