基本上我想要一个按钮,在包含我的http://fake.com/Report/PageFixes...页面的新窗口中打开一个页面.目前我在一个表单中有一个按钮,但如果有更好的方法,那么我也是这样做的.
<% using (Html.BeginForm("PageFixes", "Report", new { id = 9 }, FormMethod.Get, new { onSubmit="window.open()" })) %>
<% { %>
<%= Html.CSButton(new ButtonViewData() { Text = "Submit" })%>
<% } %>
Run Code Online (Sandbox Code Playgroud) 你好,
我正在学习LINQ并遇到了一个问题.我创建了一个针对northwind db的简单查询,我正在塑造应该返回的字段.问题是运行后,我无法修改我的AspxGridView中的任何字段.
<dxwgv:ASPxGridView ID="ASPxGridView1" runat="server"
AutoGenerateColumns="False" KeyFieldName="CategoryID">
<Columns>
<dxwgv:GridViewCommandColumn VisibleIndex="0">
<EditButton Visible="True">
</EditButton>
<NewButton Visible="True">
</NewButton>
<DeleteButton Visible="True">
</DeleteButton>
</dxwgv:GridViewCommandColumn>
<dxwgv:GridViewDataTextColumn Caption="CategoryID" FieldName="CategoryID"
VisibleIndex="1">
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn Caption="CategoryName" FieldName="CategoryName"
VisibleIndex="2">
</dxwgv:GridViewDataTextColumn>
<dxwgv:GridViewDataTextColumn Caption="Description" FieldName="Description"
VisibleIndex="3">
</dxwgv:GridViewDataTextColumn>
</Columns>
</dxwgv:ASPxGridView>
Run Code Online (Sandbox Code Playgroud)
C#语法:
protected void Page_Load(object sender, EventArgs e)
{
NorthwindDataContext db = new NorthwindDataContext();
var r = db.Categories
.Select(p=>new {p.CategoryID,p.CategoryName,p.Description});
ASPxGridView1.DataSource = r;
ASPxGridView1.DataBind();
}
Run Code Online (Sandbox Code Playgroud)
你们可能会说这是var匿名类型的问题.但我总是需要使用匿名类型.如何解决这个问题
我在AJAX工具包的AsyncFileUpload的uploadError javascript函数中有以下内容:
function uploadError(sender, args) {
document.getElementById("<%# uploadResult.ClientID %>").innerText = args.get_fileName(), "<span style='color:red;'>" + args.get_errorMessage() + "</span>";
}
Run Code Online (Sandbox Code Playgroud)
不幸的是,ClientID调用返回Null,因此javascript错误.
我还注意到,一旦页面加载,我的控件都没有通常的.NET格式:EG:
<asp:Label runat="server" Text="Select an image to upload it to this stock item...." ID="uploadResult" />
Run Code Online (Sandbox Code Playgroud)
通常会像这样呈现:
<span id="ctl00_ContentPlaceHolder1_uploadResult">Choose a webstock file to upload...</span>
Run Code Online (Sandbox Code Playgroud)
但是使用这个文件它呈现为:
<span id="uploadResult">Select an image to upload it to this stock item....</span>
Run Code Online (Sandbox Code Playgroud)
我认为这是同一个问题,但不知道为什么会发生这种情况.
我有一个ascx控件绑定到具有频繁更改数据的数据源.是否有一种快速方法可以每隔X秒重新启动一次ascx控制回发,重新绑定和刷新.ascx控件位于更新面板中.
我有一张桌子被命名为"MYTABLE".这有两列"FIRSTNAME"和"LASTNAME".下面两个查询返回相同的结果IQueryable<MYTABLE>
dataContext.MYTABLEs.Where(f => f.FIRSTNAME == firstName && f.LASTNAME == lastName);
from t in dataContext.MYTABLEs
where t.FIRSTNAME == firstName && t.LASTNAME == lastName select t;
Run Code Online (Sandbox Code Playgroud)
有什么不同?哪两个查询更快?
如何查看页面中LinkButton单击的Page_Load内容.这是为了避免调用服务,以便它只执行其事件中存在的内容.
我有两个列表框执行添加删除项目功能,由四个按钮控制和o每个按钮点击那里碰巧回发但我不希望它是闪烁我正在使用这样的更新面板但它这个问题让我解释了这个问题
<asp:UpdatePanel ID="button" runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:Button ID="ButtonAdd" runat="server" Text=">" OnClick="ButtonAdd_Click" Width="50px"/><br />
<asp:Button ID="ButtonRemove" runat="server" Text="<" OnClick="ButtonRemove_Click" Width="50px"/><br />
<asp:Button ID="ButtonAddAll" runat="server" Text =">>>" OnClick="ButtonAddAll_Click" Width="50px"/><br />
<asp:Button ID="ButtonRemoveAll" runat="server" Text ="<<<" OnClick="ButtonRemoveAll_Click" Width="50px"/>
</ContentTemplate>
</asp:UpdatePanel>
Run Code Online (Sandbox Code Playgroud) 可以说我有以下内容:
<asp:Repeater ID="repSubItems" runat="server" DataSource="<%# SubItems %>" >
<ItemTemplate>
<sc:FieldRenderer ID="FieldRenderer1"
FieldName="BlurbSpot_Content_SubHeading"
runat="server"
Item="<%# Container.DataItem as Sitecore.Data.Items.Item %>" />
</ItemTemplate>
</asp:Repeater>
Run Code Online (Sandbox Code Playgroud)
我想在代码背后能够做到:
FieldRenderer1.Style["Width"] = MyCoolWidth;
Run Code Online (Sandbox Code Playgroud)
但在Repeater我内部无法访问FieldRenderer1控件.
asp.net ×7
javascript ×3
c# ×2
linq ×2
.net ×1
ajax ×1
ajax.net ×1
ascx ×1
asp.net-3.5 ×1
asp.net-ajax ×1
asp.net-mvc ×1
clientid ×1
linkbutton ×1
pageload ×1
postback ×1
sitecore ×1
timer ×1
updatepanel ×1