Click here to Skip to main content
15,921,295 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionASP.NET Pin
Member 468595610-Dec-12 19:59
Member 468595610-Dec-12 19:59 
AnswerRe: ASP.NET Pin
Richard MacCutchan10-Dec-12 21:32
mveRichard MacCutchan10-Dec-12 21:32 
AnswerRe: ASP.NET Pin
AmitGajjar11-Dec-12 6:48
professionalAmitGajjar11-Dec-12 6:48 
QuestionResponse.Redirect behavior Pin
AnalogNerd10-Dec-12 9:11
AnalogNerd10-Dec-12 9:11 
AnswerRe: Response.Redirect behavior Pin
David Mujica10-Dec-12 10:01
David Mujica10-Dec-12 10:01 
GeneralRe: Response.Redirect behavior Pin
AnalogNerd10-Dec-12 10:16
AnalogNerd10-Dec-12 10:16 
AnswerRe: Response.Redirect behavior Pin
Shameel10-Dec-12 21:28
professionalShameel10-Dec-12 21:28 
AnswerRe: Response.Redirect behavior Pin
AmitGajjar11-Dec-12 6:54
professionalAmitGajjar11-Dec-12 6:54 
AnswerRe: Response.Redirect behavior Pin
ZurdoDev12-Dec-12 4:36
professionalZurdoDev12-Dec-12 4:36 
GeneralRe: Response.Redirect behavior Pin
AnalogNerd12-Dec-12 4:46
AnalogNerd12-Dec-12 4:46 
QuestionERROR while updating image in database Pin
Ani199110-Dec-12 6:18
Ani199110-Dec-12 6:18 
GeneralRe: ERROR while updating image in database Pin
jkirkerx10-Dec-12 10:37
professionaljkirkerx10-Dec-12 10:37 
GeneralRe: ERROR while updating image in database Pin
Ani199110-Dec-12 21:15
Ani199110-Dec-12 21:15 
GeneralRe: ERROR while updating image in database Pin
Richard Deeming11-Dec-12 0:54
mveRichard Deeming11-Dec-12 0:54 
GeneralRe: ERROR while updating image in database Pin
jkirkerx11-Dec-12 7:26
professionaljkirkerx11-Dec-12 7:26 
Questionmaking a class with streamreader thread safe - perhaps using monitor or a singleton Pin
jkirkerx9-Dec-12 11:45
professionaljkirkerx9-Dec-12 11:45 
GeneralRe: making a class with streamreader thread safe - perhaps using monitor or a singleton Pin
jkirkerx9-Dec-12 16:14
professionaljkirkerx9-Dec-12 16:14 
QuestionDisplay Images from a database in a tile view Pin
Member 94655649-Dec-12 5:42
Member 94655649-Dec-12 5:42 
AnswerRe: Display Images from a database in a tile view Pin
Ali Al Omairi(Abu AlHassan)10-Dec-12 2:23
professionalAli Al Omairi(Abu AlHassan)10-Dec-12 2:23 
Questionlinq connection in asp.net Pin
JonBrynjar8-Dec-12 3:58
JonBrynjar8-Dec-12 3:58 
Hi all!

I have established a linq connexion with my database with this code behind.
And with manually set paging for 10 records.
data is shown in ListView.
How do I get the header sorting I'm using a linkbutton. Also I want to be able to insert a dropdownlist in the header. How do I receive this functionality.
With thanks in advance.

C#
private void DisplayData(int startRow)
    {
      using (Origo.Vefur.Linq.dbMainDataContext db = new Linq.dbMainDataContext(Origo.WMMain.Helpers.Global.ConnectionString))
      {

        var empList = from el in db.owm_USERs
                      where el.showOnWeb == 1
                      select el;

        //ListView1.DataSourceID(employeeList);
        ListView1.DataSource = empList.Skip(startRow).Take(10);
        ListView1.DataBind();
      }
    }


My list view looks now like this

XML
<asp:ListView ID="ListView1" runat="server"
      onselectedindexchanged="ListView1_SelectedIndexChanged1"
      onsorted="ListView1_Sorted" onsorting="ListView1_Sorting">
      <LayoutTemplate>
        <table id="Table1" runat="server" class="TableCSS">
          <tr id="Tr1" runat="server" class="table-header">
            <th align="left"><asp:LinkButton ID="lnkID" CommandArgument="id" CommandName="Sort" Text="id" runat="server" /></th>
            <th align="left"><asp:LinkButton ID="lnkName" runat="server">Nafn</asp:LinkButton></th>
            <th align="left">
              <asp:dropdownlist runat="server" id="ddlWrokplace"
                  DataTextField="workplace" DataValueField='<%# Eval("workplace") %>' SelectedValue='<%# Eval("workplace") %>'></asp:dropdownlist>
            </th>



But neither the sorting links nor the dropdown list are working properly
AnswerRe: linq connection in asp.net Pin
AmitGajjar11-Dec-12 7:00
professionalAmitGajjar11-Dec-12 7:00 
QuestionChange root path Pin
#realJSOP8-Dec-12 3:40
professional#realJSOP8-Dec-12 3:40 
AnswerRe: Change root path Pin
Richard Deeming10-Dec-12 1:35
mveRichard Deeming10-Dec-12 1:35 
GeneralRe: Change root path Pin
#realJSOP10-Dec-12 1:42
professional#realJSOP10-Dec-12 1:42 
AnswerRe: Change root path Pin
AmitGajjar11-Dec-12 7:10
professionalAmitGajjar11-Dec-12 7:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.