如何使用jquery(mvc 4)将图像按钮添加到对话框的小条? [英] How do add image button to tittle bar of dialog box using jquery(mvc 4)?

查看:66
本文介绍了如何使用jquery(mvc 4)将图像按钮添加到对话框的小条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< button type =submitid =btnname =Commandvalue =Cancelonclick =location.href ='<%:Url.Action(Capture,TTSCreate) %>'/>





<button type="submit" id="btn" name="Command" value="Cancel" onclick="location.href='<%: Url.Action("Capture", "TTSCreate") %>'" />


<script>
    $("[id*=btn]").click(function (e) {
        alert('This is a custom alert box', 'Alert Dialog');

    });
</script>







[HttpPost]

公共ActionResult Capture(PrtScreen prt) ,字符串命令)

{



if(command ==Cancel)

{

int FileCount = 0;



// int screenWidth = Screen.GetBounds(new Point(0,0))。宽度;

// int screenHeight = Screen.GetBounds(new Point(0,0))。高度;

位图bmpScreenShot =新位图(1920,1080);

图形gfx = Graphics.FromImage((图像)bmpScreenShot);

gfx.CopyFromScreen(0,0,0,0,新尺寸(1920,1080));

bmpScreenShot.Save(d:\\ example+ FileCount +.jpg,ImageFormat.Png);



}




[HttpPost]
public ActionResult Capture(PrtScreen prt, string command)
{

if (command == "Cancel")
{
int FileCount = 0;

//int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
//int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(1920, 1080);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(1920, 1080));
bmpScreenShot.Save("d:\\example" + FileCount + ".jpg ", ImageFormat.Png);

}

推荐答案

([id * = btn])。click(function(e){
alert('这是一个自定义警告框') ,'警报对话');

});
< / script >
("[id*=btn]").click(function (e) { alert('This is a custom alert box', 'Alert Dialog'); }); </script>







[HttpPost]

公共ActionResult Capture(PrtScreen prt) ,字符串命令)

{



if(command ==Cancel)

{

int FileCount = 0;



// int screenWidth = Screen.GetBounds(new Point(0,0))。宽度;

// int screenHeight = Screen.GetBounds(new Point(0,0))。高度;

位图bmpScreenShot =新位图(1920,1080);

图形gfx = Graphics.FromImage((图像)bmpScreenShot);

gfx.CopyFromScreen(0,0,0,0,新尺寸(1920,1080));

bmpScreenShot.Save(d:\\ example+ FileCount +.jpg,ImageFormat.Png);



}




[HttpPost]
public ActionResult Capture(PrtScreen prt, string command)
{

if (command == "Cancel")
{
int FileCount = 0;

//int screenWidth = Screen.GetBounds(new Point(0, 0)).Width;
//int screenHeight = Screen.GetBounds(new Point(0, 0)).Height;
Bitmap bmpScreenShot = new Bitmap(1920, 1080);
Graphics gfx = Graphics.FromImage((Image)bmpScreenShot);
gfx.CopyFromScreen(0, 0, 0, 0, new Size(1920, 1080));
bmpScreenShot.Save("d:\\example" + FileCount + ".jpg ", ImageFormat.Png);

}


你不能修改警告框,你需要使用模态弹出框架,比如jQuery UI的对话框。
You can't modify the alert box, you'll need to use a modal popup framework instead, like jQuery UI's dialog.


这篇关于如何使用jquery(mvc 4)将图像按钮添加到对话框的小条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆