Click here to Skip to main content
15,883,901 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Team

I have a working button but its not closer to the another one(Upload) button, how can i achieve such on the View.cshtml?

What I have tried:

ASP.NET
<pre>  @using (Html.BeginForm("Browse", "Week", FormMethod.Post, new { enctype = "multipart/form-data", @id = "upload" }))
    {
        

        @Html.ActionLink("Create New", "Create", routeValues: new { }, htmlAttributes: new { @class = "modal-link btn btn-primary" })



        <input type="file" id="fileUpload" name="upload" class="btn-primary" required style="display:none;" />
        <label for="fileUpload" id="button" class="btn btn-primary">Upload</label>
        <input type="submit" name="extract" class="btn-primary" required style="display:none;" />

       
    }
    @using (Html.BeginForm("ExportToExcel", "Week", FormMethod.Post, new { enctype = "multipart/form-data" }))
    {

        <div>
            <input type="submit" value="Extract" class="btn btn-primary" />
        </div>
    }
Posted
Updated 22-Apr-21 22:22pm

1 solution

Since you haven't clearly explained what the problem is, we can only offer generic advice.

Use CSS to change the layout; or put both buttons in the same form and use the value of the clicked button to choose what to do on the server; or put both buttons in the same form and use the formaction attribute to have one button submit to a different action.

HTML formaction Attribute[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900