小编sly*_*dan的帖子

Json ajax参数传递

function BindJson() {
        $.ajax({
            type: "POST",
            url: "NewPage.aspx/SerializeJson",
            data: "{}",
            contentType: "application/json",
            dataType: "json",
            success: function (data1) {
                alert(data1);
            }
        })
    }
    [WebMethod]
        public static string SerializeJson()
        {
            JavaScriptSerializer js = new JavaScriptSerializer();
            //Person p2 = js.Deserialize<Person>(str);
            return "";
        }
Run Code Online (Sandbox Code Playgroud)

如何将参数作为数据传递给我的serializeJson函数?

asp.net jquery json

5
推荐指数
1
解决办法
4万
查看次数

如何在sql server中维护换行符

我有一个带有换行符的 asp.net 文本框,并且 sql server 2008 中不维护换行符。我该如何执行此操作?

sql-server

5
推荐指数
1
解决办法
1万
查看次数

为什么GridView Rowupdating事件不捕获文本框的新值?

我正在使用gridview.当我单击编辑按钮时,会出现更新和取消按钮.在修改来自EditItemTemplate的文本框中的值时,新值不会显示在事件处理程序rowupdating()中,而是获取在呈现页面时显示的值.如何从这些文本框中获取新值并继续进行?这是代码.

<asp:GridView ID="GridView1" runat="server" AutoGenerateEditButton="true" AutoGenerateColumns="false" 
        AutoGenerateDeleteButton="true" onrowediting="GridView1_RowEditing" 
        onrowupdating="GridView1_RowUpdating">
    <Columns>


    <asp:TemplateField>
    <ItemTemplate>
        <asp:Label ID="lblId" runat="server" Text='<%# Eval("id") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="txtId" runat="server" Text='<%# Eval("id") %>'></asp:TextBox>
    </EditItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField>
    <ItemTemplate>
        <asp:Label ID="lblName" runat="server" Text='<%# Eval("cpuname") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("cpuname") %>'></asp:TextBox>
    </EditItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField>
    <ItemTemplate>
        <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("status") %>'></asp:Label>
    </ItemTemplate>
    <EditItemTemplate> 
      <asp:TextBox ID="txtStatus" runat="server" Text='<%# Eval("status") %>'></asp:TextBox>
     </EditItemTemplate>
    </asp:TemplateField>

    </Columns>


</asp:GridView>


protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
        {
            GridView1.EditIndex = e.NewEditIndex;
        }

        protected void GridView1_RowUpdating(object …
Run Code Online (Sandbox Code Playgroud)

.net asp.net gridview

4
推荐指数
1
解决办法
1万
查看次数

如何在 Django 中为用户创建注册表

Django 创建用户的方式是什么?我不是在谈论超级用户,只是一个简单的用户表单和创建帐户

django

4
推荐指数
1
解决办法
5507
查看次数

Collections和List如何存储不同类型的对象?可能吗?

泛型集合和List如何存储不同类型的对象?可能吗?

因为集合和列表是arraylist的替代品

c#

3
推荐指数
1
解决办法
5826
查看次数

如何使用sqlserver存储会话状态?

<sessionState mode="SQLServer"
  cookieless="true"
  regenerateExpiredSessionId="true"
  timeout="30"
  sqlConnectionString="Data Source=MICHAEL;Integrated Security=SSPI;"
  stateNetworkTimeout="30"/>
Run Code Online (Sandbox Code Playgroud)

我不知道我做错了什么.

asp.net

3
推荐指数
1
解决办法
2991
查看次数

MVC给出了一个奇怪的错误

我得到的错误信息是:

传递到字典中的模型项的类型为'System.Data.Linq.DataQuery`1 [MvcApplication1.ContentPageNav]',但此字典需要类型为"MvcApplication1.ContentPageNav"的模型项.

public ActionResult Edit()
{
   DataClasses1DataContext dc = new DataClasses1DataContext();
   var model = from m in dc.ContentPageNavs
      select m;
   return View(model);
}
Run Code Online (Sandbox Code Playgroud)

关于我为何会收到此错误的任何想法?任何帮助将不胜感激.

c# linq asp.net-mvc

3
推荐指数
1
解决办法
116
查看次数

带有Firefox innerText问题的Javascript

function OpenWindow(anchor) {
        var toUsername = anchor.innerText;
        window.open("ChatWindow.aspx?username=" + toUsername,'_blank', "width=340,height=200");       
    }
Run Code Online (Sandbox Code Playgroud)

这个函数在firefox中打开一个参数为undefined的页面,在google chrome中我获得了适当的值.

Firefox网址: http:// localhost:9452/ChatWindow.aspx?username = undefined

这个问题的解决方案是什么?

javascript firefox

3
推荐指数
1
解决办法
1万
查看次数

FormView不会进入插入模式.为什么?

<asp:FormView ID="FormView1" runat="server" AllowPaging="True" 
        DataSourceID="SqlDataSource1" OnModeChanging="FormView1_ModeChanging">
        <EditItemTemplate>
            ID :
            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
            <br />
            CpuName :
            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            <br />
            Status :
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
        </EditItemTemplate>
        <EmptyDataTemplate>
            There is no data.
        </EmptyDataTemplate>
    <ItemTemplate>
     <table>
      <tr>
        <td align="right"><b>ID: </b></td>       
        <td><%# Eval("Id") %></td>
      </tr>
      <tr>
        <td align="right"><b>CPUName:</b></td>     
        <td><%# Eval("cpuname") %></td>
      </tr>
      <tr>
        <td align="right"><b>Status</b></td>      
        <td><%# Eval("status") %></td>
      </tr>

    </table>        
    <asp:LinkButton CommandName="Edit" runat="server">Edit</asp:LinkButton>
    <asp:LinkButton CommandName="Insert" runat="server">Insert</asp:LinkButton>
    </ItemTemplate>
    <InsertItemTemplate>
     <table>
      <tr>
        <td align="right"><b>ID: </b></td>       
        <td>
            <asp:TextBox ID="txtFVID" runat="server"></asp:TextBox></td>
      </tr>
      <tr>
        <td align="right"><b>CPUName:</b></td> …
Run Code Online (Sandbox Code Playgroud)

.net c# asp.net formview

2
推荐指数
1
解决办法
4657
查看次数

如何在ActionLink上进行局部视图

   <table>
    <tr>
        <th>
            Author
        </th>
        <th>
            Title
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Author)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Title)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
            @Ajax.ActionLink("View Reviews", "View", new { id = item.ID }, new AjaxOptions { UpdateTargetId = "result", InsertionMode = InsertionMode.InsertAfter })

        </td> 
    </tr>
}

</table>

<div id="result">

</div>
public PartialViewResult View(int id)
        {
            ReviewModel …
Run Code Online (Sandbox Code Playgroud)

asp.net-mvc

2
推荐指数
1
解决办法
7091
查看次数

标签 统计

asp.net ×4

c# ×3

.net ×2

asp.net-mvc ×2

django ×1

firefox ×1

formview ×1

gridview ×1

javascript ×1

jquery ×1

json ×1

linq ×1

sql-server ×1