Tag: twitter bootstrap

bootstrap modal popup c#codebehind

我在我的c#asp.net项目中使用bootstrap,我想显示从后面的代码显示模态弹出窗口。 在我的页面标题我有一个javascript函数如下: function LoginFail() { $(‘#windowTitleDialog’).modal(‘show’); } 并点击我的按钮我调用javascript如下 ScriptManager.RegisterClientScriptBlock(this, typeof(System.Web.UI.Page), “LoginFail”, “LoginFail();”, true); 这不会显示模态弹出窗口。 但是,如果我使用类似alert(‘login failed’) ,它工作正常。 任何人都可以帮忙吗?

Request.Files相同的文件上传asp.net mvc

foreach (string fileName in Request.Files) { HttpPostedFileBase file = Request.Files[fileName]; //Save file content goes here fName = file.FileName; if (file != null && file.ContentLength > 0) { subPath = ConfigurationManager.AppSettings[“SubPath”].ToString() + “/” + currentUserId; bool isExists = System.IO.Directory.Exists(Server.MapPath(subPath)); if (!isExists) System.IO.Directory.CreateDirectory(Server.MapPath(subPath)); string path = System.IO.Path.Combine(Server.MapPath(subPath), System.IO.Path.GetFileName(file.FileName)); file.SaveAs(path); } } 如果我上传多个文件,我会得到相同的文件n次。 我正在使用此控件: https : //github.com/kartik-v/bootstrap-fileinput 我的cs.html […]

格式化asp:DataPager以在ul li中显示

我正在使用Twitter Bootstrap和ASP.Net C#Webforms构建一个网站。 我的页面上有一个ListView,其中绑定了一个DataPager,但是我需要改变.Net呈现DataPager的HTML的方式。 目前,所有寻呼机项目都显示如下: First 1  2  Last  但是我需要将所有项目包装在无序列表中,而不是跨度和标签。 我目前的加价看起来像这样: 我不知何故需要覆盖NextPreviousPagerField和NumericPagerField,因此它们输出 标签而不是和。

ASP.NET MVC,Bootstrap Tables,获取每列的值

在ASP.NET MVC中,我有一个操作,它接受用户对行和列的输入,然后导航到根据用户输入生成所需行数和列数的操作,如下所示: – 浏览次数: @using (Html.BeginForm()) { @for (int k = 0; k < Model.Rows.Capacity; k++) { @for (int i = 0; i < Model.Columns.Capacity; i++) { @Html.TextBox(“name” + k + i, null, new { @class = “form-control” }) } } } 进入后。 http://sofzh.miximages.com/c%23/lxhOM.png 在post动作中,我有一个表单集合,以便使用表单集合在post动作中获取填充的数据。 在post动作中,我使用foreach循环获取每个输入字段的值。 [HttpPost] public ActionResult Enter(FormCollection form) { for (int i […]

Button Group of Radio Buttons没有设置任何带Bootstrap 3的活动按钮

我试图用MVC和Bootstrap 3创建一组很好的单选按钮: 选择一个选项后: 我将值存储在数据库中但是当我再次显示View时,没有选择任何内容: 该模型是: [Table(“QuotePiecePrinting”)] public partial class QuotePiecePrinting { [Key] [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Display(Name = “Tipo de Impressão”)] public int PrintType { get; set; } } 观点是: @Html.LabelFor(model => model.PrintType, htmlAttributes: new { @class = “control-label col-xs-12 col-sm-4 col-md-3” }) @Html.RadioButtonFor(model => model.PrintType, “1”) Digital @Html.RadioButtonFor(model => model.PrintType, […]

修改不同用户的_layout

在我的应用程序中,我有带菜单的导航栏。 在菜单中我有3个下拉菜单。 上市 对于普通用户 对于管理员 访问受到限制,但菜单对所有人都可见。 我想隐藏普通和公共(anynymous)用户不必要的元素。 为了识别我正在使用Windows登录名 要获取用户角色,我要求数据库和查询返回用户是普通用户还是管理员。 我的解决方案 public bool CheckIfAdmin(string login) { bool admin = false; EquipmentEntities db = new EquipmentEntities(); Tuple credentials = GetName(login); int RoleId = db.Users.Where(w => w.Name == credentials.Item1).Where(w => w.Surname == credentials.Item2).Select(s => s.RoleId).FirstOrDefault(); if(RoleId==1) { admin = true; } return admin; } 和用于检查用户的几乎相同的代码 在方法中: if(CheckIfAdmin(login)){ ViewBag.Role=1; […]

Azure引导字体

似乎无法解决这个问题,我将自定义引导程序css和字体插入到我的azure色cdn中,但在chrome中我一直得到“来自原点的字体” http://azxxxxxx.vo.msecnd.net ‘已被阻止加载由Cross-Origin资源共享策略:请求的资源上不存在“Access-Control-Allow-Origin”标头。因此不允许来源“ http://localhost.domain:16300 ”。 我修改了我的bootstrap css font-face { font-family: ‘Glyphicons Halflings’; src: url(‘//azxxxxxx.vo.msecnd.net/fonts/glyphicons-halflings-regular.eot’); src: url(‘//azxxxxxx.vo.msecnd.net/fonts/glyphicons-halflings-regular.eot?#iefix’) format(’embedded-opentype’), url(‘//azxxxxxx.vo.msecnd.net/fonts/glyphicons-halflings-regular.woff’) format(‘woff’), url(‘//azxxxxxx.vo.msecnd.net/fonts/glyphicons-halflings-regular.ttf’) format(‘truetype’), url(‘//azxxxxxx.vo.msecnd.net/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular’) format(‘svg’); } 我已经阅读了一些stackoverflowpost,将以下内容添加到我的webconfig中 仍然有同样的问题,任何想法?

单击“提交”按钮时,我的ASPX文件中的第二个模态不会发布

我有一个ASPX文件,包含两个模态(myModal和addModal)和一个gridview,其中有按钮调用这些模式。 我在打开并单击其提交按钮时遇到第二个模式的问题,因为它不会触发PostBack。 它只是第二个问题。 如果我在ASPX文件中更改这些Modals的顺序,那么我再次遇到麻烦只有文件中的第二个。 当在同一个ASPX页面中有两个模态来触发PostBack时,还需要一些额外的东西吗? 这是ASPX和C#文件: C#文件: protected void Page_Load(object sender, EventArgs e) { try{ if (IsPostBack) { Control control = null; string controlName = Request.Params[“__EVENTTARGET”]; if (!String.IsNullOrEmpty(controlName)) { control = FindControl(controlName); GridViewRow gvRow1 = (GridViewRow)control.Parent.Parent; string controlID = control.ID.ToString(); } } if(!IsPostBack) { DataGrid_Load(DAL.reg(HeadText.Text, OrgText.Text), “reg”); ErrorText.Text = “NO POSTBACK”; } } catch{} } […]

MVC5使用MvcSiteMapProvider构建twitter bootstrap菜单

MVC5模板中的默认菜单部分如下所示: @Html.ActionLink(“Home”, “Index”, “Home”) @Html.ActionLink(“About”, “About”, “Home”) @Html.ActionLink(“Contact”, “Contact”, “Home”) @Html.Partial(“_LoginPartial”) _LoginPartial看起来像这样: @using Microsoft.AspNet.Identity @if (Request.IsAuthenticated) { using (Html.BeginForm(“LogOff”, “Account”, FormMethod.Post, new { id = “logoutForm”, @class = “navbar-right” })) { @Html.AntiForgeryToken() @Html.ActionLink(“Hello ” + User.Identity.GetUserName() + “!”, “Manage”, “Account”, routeValues: null, htmlAttributes: new { title = “Manage” }) Log off } } else { […]

ASP.NET WebForms模式弹出窗口

我想知道在ASP.NET WebForms应用程序中显示模式弹出窗口的最佳方法是什么。 我需要用2个按钮显示模态窗口(确定/取消)并在我的代码中按下按钮。 我应该用它来实现它 – 来自AjaxControlToolkit,bootstrap模式弹出窗口或jQuery UI的ModalPopupExtender? 我是ASP.NET WebForms的新手,所以源代码或教程的例子会派上用场。 谢谢!