filmov
tv
How do you handle multiple submit buttons in ASP NET MVC

Показать описание
Multiplebutton check code here:
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class MultipleButtonAttribute : ActionNameSelectorAttribute
{
public string Name { get; set; }
public string Argument { get; set; }
public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
{
var isValidName = false;
var keyValue = string.Format("{0}:{1}", Name, Argument);
var value = controllerContext.Controller.ValueProvider.GetValue(keyValue);
if (value != null)
{
controllerContext.Controller.ControllerContext.RouteData.Values[Name] = Argument;
isValidName = true;
}
return isValidName;
}
}
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public class MultipleButtonAttribute : ActionNameSelectorAttribute
{
public string Name { get; set; }
public string Argument { get; set; }
public override bool IsValidName(ControllerContext controllerContext, string actionName, MethodInfo methodInfo)
{
var isValidName = false;
var keyValue = string.Format("{0}:{1}", Name, Argument);
var value = controllerContext.Controller.ValueProvider.GetValue(keyValue);
if (value != null)
{
controllerContext.Controller.ControllerContext.RouteData.Values[Name] = Argument;
isValidName = true;
}
return isValidName;
}
}
How to Manage Multiple Interests
How to carry four plates like a pro!
How Do You Handle Multiple Tasks Efficiently?
How to handle a job offer when you have other interviews.
HOW DO YOU PRIORITIZE YOUR WORK? (The BEST ANSWER to this TOUGH Interview Question!)
How to handle multiple projects at the same time | school + work
How I handle multiple Python Versions (pyenv)
How you would handle finishing multiple tasks-How to Answer Interview Questions
3 Offers, 1 Big Decision: How to Handle Multiple Offers Like a Pro 🏡💥 | Home Selling Tips 2025
Working Two Jobs At Once
What should you do when you get offered your dream job but you just accepted another offer? 😬😅
Self Defense Against Multiple Attackers 12 on 1
Writing Main Characters: How to Handle Multiple Protagonists
How Do You Handle Multiple Worship Leaders?
How to defend against multiple attackers!
Multiple Job Offers? Here's How to Handle!
Most Effective Way To Manage Your Time (Framework)
IT:Interview Question: How to handle Multiple Issues At The Same Time? Experience Or No Experience
How to Handle Domains and Hosting for Clients (And Earn Passive Income too!)
Tips to Handle Multiple Job Offers, Recruiter Pressure Tactics & More | Indeed
How to manage your time more effectively (according to machines) - Brian Christian
TOO MANY EMAILS? Use THESE Proven Techniques | Outlook tips included
Multiple Business Ko kaise handle kare?
How To Handle Permissions Like A Senior Dev
Комментарии