I'm making a local CMS where I can create/edit/delete Posts, Tags, Authors and Roles, using *.ashx handlers. The Posts and Tags had been working fine, until I added functionality for authors and roles. Since adding those, whenever I tried to create/edit/delete a Post or Tag, I received the "Server error in '/' application: Resource cannot be found" error with, for example, Requested URL: /admin/post.ashx.

I found that it was most likely due to a copy/paste typo I made in web.config for removing and adding handlers, where I removed the Post and Tag handlers twice:

<system.webServer>
  <handlers>
    <remove name="PostHandler"/>
    <add name="PostHandler" type="PostHandler" verb ="POST" path="/admin/post.ashx"/>
    <remove name="TagHandler"/>
    <add name="TagHandler" type="TagHandler" verb ="POST" path="/admin/tag.ashx"/>
    <remove name="PostHandler"/>
    <add name="AccountHandler" type="AccountHandler" verb ="POST" path="/admin/account.ashx"/>
    <remove name="TagHandler"/>
    <add name="RoleHandler" type="RoleHandler" verb ="POST" path="/admin/role.ashx"/>
  </handlers>
</system.webServer>

The handler code now looks like this:

<system.webServer>
  <handlers>
    <remove name="PostHandler"/>
    <add name="PostHandler" type="PostHandler" verb ="POST" path="/admin/post.ashx"/>
    <remove name="TagHandler"/>
    <add name="TagHandler" type="TagHandler" verb ="POST" path="/admin/tag.ashx"/>
    <remove name="AccountHandler"/>
    <add name="AccountHandler" type="AccountHandler" verb ="POST" path="/admin/account.ashx"/>
    <remove name="RoleHandler"/>
    <add name="RoleHandler" type="RoleHandler" verb ="POST" path="/admin/role.ashx"/>
  </handlers>
</system.webServer>

However, having corrected the typos, I'm still receiving the same error for posts and tags only. I've tried rebuilding the solution, rebuilding website, reloading visual studio and clearing cache/browsing history, etc. in my browser, but I'm still having a problem creating/editing/deleting Posts and Tags. Roles and Accounts are fine.

I'm completely stumped - any ideas on what I need to do to rectify this?

I have a model that has an object array as one of its attributes. For example:

class Person {
 int id;
 string name;
 int age;
 Work[] workExperiences;
}

class Work {
 int id;
 string address;
 string position;
}

Person and Work are tables in the database. How do I create a stored procedure so I can retrieve all the information in one query?

I am developing a website using ASP.net. In there users can upload images. When I am saving images I am saveing a small version ( Thumbnail ) image. To do that I use this code

public void SaveThumbnailImage(Stream sourcePath, int width, int height, string imageFileName)
{
    using (var image = System.Drawing.Image.FromStream(sourcePath))
    {
        //a holder for the result
        Bitmap result = new Bitmap(width, height);

        //set the resolutions the same to avoid cropping due to resolution differences
        result.SetResolution(image.HorizontalResolution, image.VerticalResolution);

        //use a graphics object to draw the resized image into the bitmap
        using (Graphics graphics = Graphics.FromImage(result))
        {
            //set the resize quality modes to high quality
            graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
            graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;
            graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
            graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
            //draw the image into the target bitmap
            graphics.DrawImage(image, 0, 0, result.Width, result.Height);
        }

        thumbnailfullImagePath = string.Format("/Images/thumbnail/{0}", imageFileName);
        result.Save(Server.MapPath(thumbnailfullImagePath), image.RawFormat);
    }
}

height is :105 width is 150

Above cord working fine for landscape type photos. But If I upload a portrait photos its not maintain its correct resolotuions. So how to optimize above code to save the thumbnail while keeping its original width to height ratio?

I want pass a number from view to controller for verification. Can u help me?(tell me a sample code which i should be writing in view and controller)

i'm trying to convert a gridview into a listview. The bit that is troubling me is that i can't get at following codes

TextBox box1 = (TextBox)Gridview1.Rows(rowIndex).Cells(1).FindControl("clientCode");

Please help me to achieve this code in Listview Format.

for better performance and rendering output of page DNN offer outputting Cache . it cache all module and output of the page . if page caching is enabled for this page :

http://example.com/pageName/

and some module get get method parameters it become dynamic page and caching should be disabled . how is it possible to disable caching when parameters passed to the page

http://example.com/pageName/articleid/123

I am working on a project where i click on human image part and its show symptoms.For this i use web service which return json data perfectly.here is my web service code:

public class SympsService : System.Web.Services.WebService
{
    [WebMethod]
    public void GetSymptoms(String organ_name)
    {
        List<symps> listSymptoms = new List<symps>();
        string CS=ConfigurationManager.ConnectionStrings["EhealtsCS"].ConnectionString;
        using (SqlConnection con = new SqlConnection(CS))
        {
            SqlCommand cmd = new SqlCommand("sendSymptoms", con);
            cmd.CommandType = CommandType.StoredProcedure ;
            SqlParameter parameter = new SqlParameter();
            parameter.ParameterName = "@organ";
            parameter.Value = organ_name;
            cmd.Parameters.Add(parameter); con.Open();
            SqlDataReader rdr = cmd.ExecuteReader();
            while (rdr.Read())
            {
                symps symp = new symps();
                symp.Sympt = rdr["SymptomsName"].ToString();
                listSymptoms.Add(symp);

            }
            JavaScriptSerializer js = new JavaScriptSerializer();
            Context.Response.Write(js.Serialize(listSymptoms));
        }

i use jquery datatables plugin for binding json data in a table.But when i click image my jquery code is not showing json data on the table.Here is my Jquery code:

if (e.key === 'toes'){
          $.ajax({
                url: "SympsService.asmx/GetSymptoms",
                data:{ organ_name: toes},
                method: "post",
                dataType: "json",
                success: function (data){
                    var Variable = $('#symptomsTable').DataTable({
                        data: data,
                        columns: [ { 'data': 'Sympt' }]
                    });
                },
            error: function (error)
            {console.log(error);}
        });
    }

i also tried this jquery for showing json data in table but this is not working:

success: function (data) {
                    var symptomsTable = $('#symptomsTable tbody');
                    symptomsTable.empty();
                    $(data).each(function(index,symp) {
                        symptomsTable.append('<tr><td>' + symp.sympt + '</td></tr>');
                    });
                }

PLEASE,can anyone tell me what is wrong in my code.any kind of help will be greatly appreciated.

I am currently developing a website. I have an a code in my external js file

 function DeleteConfirm(rfqcodeLB) {
    var confirm_value = document.createElement("INPUT");
    confirm_value.type = "hidden";
    confirm_value.name = "confirm_value";
    if (confirm("Are you sure you want to delete" + rfqcodeLB +" ?")) {
        confirm_value.value = "Yes";
    } else {
        confirm_value.value = "No";
    }
    document.forms[0].appendChild(confirm_value);
}

What I want to do is get the id of the selected row in the gridview. What i did was transfer the selected code into string which is rfqcodeLB. And then put the attribute to the button. But it shows null.

Can someone please help me? Thanks.

<asp:ImageButton ImageUrl="../Pictures/Icons/deleteblack.png" runat="server" OnClick="Unnamed_Click" ID="deleteBT" OnClientClick="return DeleteConfirm(ContentPlaceHolder1_rfqcodeLB);"/>

This question already has an answer here:

I have a concurrent bag filled with strings like this:

var bag = new ConcurrentBag<string>();

The collection contains 100 strings from which I need to find a phrase like in following example:

"Galaxy S7" - search phrase

And lets say the titles are:

Samsung galaxy S4
Samsung galaxy S5
Samsung galaxy S6
Samsung galaxy S7

The output that I would get is:

Samsung galaxy S4
Samsung galaxy S5
Samsung galaxy S6

I've tried it with the method "Contains" that string has like following:

var _items = new ConcurrentBag<SearchItems>();
Parallel.For(0, xdoc.GetElementsByTagName("item").Count, index =>
{
    if (negative != null && negative != "")
    {
        if (!xdoc.GetElementsByTagName("title").Item(index).InnerText.Contains(negative))
        {
            _items.Add(new SearchItems() { 
                    CurrentPrice = Convert.ToDouble(xdoc.GetElementsByTagName("convertedCurrentPrice").Item(index).InnerText), 
                    ItemID = xdoc.GetElementsByTagName("itemId").Item(index).InnerText, 
                    Title = xdoc.GetElementsByTagName("title").Item(index).InnerText });
        }
    }
    else
    {
        _items.Add(new SearchItems() { 
                CurrentPrice = Convert.ToDouble(xdoc.GetElementsByTagName("convertedCurrentPrice").Item(index).InnerText), 
                ItemID = xdoc.GetElementsByTagName("itemId").Item(index).InnerText, 
                Title = xdoc.GetElementsByTagName("title").Item(index).InnerText });
    }
});

The problem is, contains is not case sensitive and if I try to exclude

s7

and

S7

I don't get same results... I need some solution that is not case sensitive :/

Can someone help me out?

I've got a ListView which contains edit,delete and add. All good here, however the List is too large and I would like give users a serach functionality with text box and button.

When user clicks on search button, List view gets filtered by search criteria.

could someone help me to achieve this please. Thank you

I have a GridView inside an update panel that holds stock code information and is binded to a DataSource based on user search of stock code.

Results are returning fine when user searches for stock code, there are also 2 text boxes and a label field that are added to each row in the gridview that will take user inputs for Order Quantity and Line Discount and finally show Line total respectively.

I am now trying to use onkeyup events and JQuery for these Text boxes to calculate line totals, but nothing works. I have done some checking and see that the Grid View is not populating in HTML table format in the Source code of the web page which leads me to believe that the JQuery is unable to find the control Id's which means it will not be able to do the calculation when onkeyup event is fired. Is there anything I need to be looking for:

ASP:

<asp:UpdatePanel ID="upAddOrderItems" runat="server">
                                <ContentTemplate>
                                <div class="row">
                                    <div class="col-md-12">
                                        <asp:GridView ID="grvStockCodes"
                                            runat="server"
                                            AutoGenerateColumns="False"
                                            CssClass="table table-striped"
                                            AlternatingRowStyle-BackColor="#E4EAEE">
                                            <HeaderStyle HorizontalAlign="Center" />
                                            <AlternatingRowStyle BackColor="#E4EAEE" />
                                            <Columns>
                                                <asp:TemplateField HeaderText="StockCode">
                                                    <HeaderStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:Label ID="lblStockCode"
                                                                Text='<%# DataBinder.Eval(Container.DataItem, "StockCode") %>'
                                                                runat="server">
                                                            </asp:Label>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Description">
                                                    <HeaderStyle CssClass="col-md-5 col-sm-5" />
                                                    <ItemStyle CssClass="col-md-5 col-sm-5" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:Label ID="lblDescription"
                                                                Text='<%# DataBinder.Eval(Container.DataItem, "Description") %>'
                                                                runat="server">
                                                            </asp:Label>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Price(excl)">
                                                    <HeaderStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:Label ID="lblPrice"
                                                                Text='<%# DataBinder.Eval(Container.DataItem, "SellingPrice") %>'
                                                                ItemStyle-CssClass="price"
                                                                runat="server">
                                                            </asp:Label>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="OrderQty">
                                                    <HeaderStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:TextBox ID="txtOrderQty" onKeyUp="calculateTotals();"
                                                                runat="server">
                                                            </asp:TextBox>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Discount">
                                                    <HeaderStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:TextBox ID="txtDiscount"
                                                                runat="server">
                                                            </asp:TextBox>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="LineTotal(excl))">
                                                    <HeaderStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemStyle CssClass="col-md-1 col-sm-1" />
                                                    <ItemTemplate>
                                                        <div style="float: left">
                                                            <asp:Label ID="lblLineTotal"
                                                                runat="server"
                                                                Text ="0.00">
                                                            </asp:Label>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </div>
                                </div>
                                    <div class="divider gap-top-20 gap-bottom-45"></div>
                                    <asp:Button ID="btnConfirmOrderDetails" runat="server" Text="Confirm Order Details" CssClass="btn btn-primary pull-right" OnClick="btnConfirmOrderDetails_Click" />
                                </ContentTemplate>
                            </asp:UpdatePanel>

JQuery

<script type="text/javascript">
        $(function CalculateTotals() {
            $("[id*=txtOrderQty]").val("0");
        });
        $("[id*=txtOrderQty]").live("change", function () {
            if (isNaN(parseInt($(this).val()))) {
                $(this).val('0');
            } else {
                $(this).val(parseInt($(this).val()).toString());
            }
        });
        $("[id*=txtOrderQty]").live("keyup", function () {
            if (!jQuery.trim($(this).val()) == '') {
                if (!isNaN(parseFloat($(this).val()))) {
                    var row = $(this).closest("tr");
                    $("[id*=lblLineTotal]", row).html(parseFloat($(".price", row).html()) * parseFloat($(this).val()));
                }
            } else {
                $(this).val('');
            }
        });
    </script>

on

@Scripts.Render("~/bundles/jquery")

I get a javascript error that shows what is suppose to be the content of jquery.js be actually what's inside is the content of my _layout.cshtml page.

Do you know why ?

I have a MVC Class outputting me a list of users grades and the number of them:

public class GradeNumModel
{
    public int Grade;
    public int Count;
}

Acompanied by an array of subject names:

public class GradeListModel { public string[] Names = new string[7];

    public GradeListModel()
    {
        //Ustawienie pierwszych indeksów na zero pomaga uniknąć problemów przy dodawaniu wartości
        Names[0] = "";
        Names[1] = "Niedostateczny";
        Names[2] = "Dopuszczający";
        Names[3] = "Dostateczny";
        Names[4] = "Dobry";
        Names[5] = "Bardzo Dobry";
        Names[6] = "Celujący";
    }
}

Now In my View I have a javascript library called Chartist to create charts, to which I would like the such data to be applied.

Here is how I (wanted to) insert my model data into the JS

                        var data = {
                            labels: [
                                @foreach (var Gr in Model.AllGradesNum)
                                {
                                    string.Join(Model.GradeList.Names.ElementAt(@Gr.Grade), ", ");
                                }
                            ],
                            series: [
                                @foreach (var Gr in Model.AllGradesNum)
                                {
                                    string.Join(Gr.Count.ToString(), "0, ");
                                }
                            ]
                        };

The problem us such configuration outputs no value at all. Even trying to print the values in the normal div pops up nothing.

The console reports no error as well, checking the sources shows two empty arrays:

                var data = {
                    labels: [
                    ],
                    series: [
                    ]
                };

What could be the issue here and how can I fix it?

**EDIT: ** Outputting the values like this:

  @foreach (var Gr in Model.AllGradesNum)
                        {
                            <p>@Gr.Count + @Gr.Grade</p>
                        }

Works without issue and displays correct data

I am currently adding errors like this:

foreach (var failedRule in failedRules)
{
    if (failedRule.Key == "TOP")
    {
        ModelState.AddModelError(typeof(MyViewModel).Name, failedRule.ErrorMsg);
    }
}

I can current print the errors if I print them manually:

@if (ViewData.ModelState.ContainsKey(typeof(MyViewModel).Name))
{
    foreach (ModelError error in ViewData.ModelState[typeof(MyViewModel).Name].Errors)
    {
        @Html.Raw(error.ErrorMessage + "<br/>");
    }
}

However, when I try to print them autmatically like this, nothing comes out:

@Html.ValidationSummary(typeof(MyViewModel).Name)

But nothing get printed, what am I doing wrong? I guess ValidationSummary doesn't know which ModelState to print, how do I tell it to use the specific key I have?

I imported the .rpt file as stated in this post. But when trying to run the option "Log On or Off Server...", the Report interface is requesting a .xsd file.

According to this post the .xsd file is stored in the report. But my .xsd file is missing, it's not inside or outside the report.

So why is the .xsd file supposedly lost when i import an .rpt from another project?

I'm getting an ASP Error, according to Resharper, "Solution MembersOrderEntry.sln Project MembersOrderEntry MembersOrderEntry\segovias-abq\Default.aspx:1 Cannot resolve symbol 'segovias-abq'"

In the same Default.aspx file, there is a similar error, "Solution MembersOrderEntry.sln Project MembersOrderEntry MembersOrderEntry\segovias-abq\Default.aspx:1 Cannot resolve symbol '_Default'"

Why are these symbols ('segovias-abq' and '_Default') unresolvable? The project contains many files named Default.aspx, with Default.aspx.vb beneath them; most of them throw no errors. But after letting Resharper "fix" funky namespace (where it thought they were wrong), I'm getting four of these errors.

Why are the lion's share of the Default.aspx files able to resolve their parent file, but this one is not? As you can see here, the relationship between the failing one and others are the same (a folder name, with Default.aspx beneath that, and Default.aspx.vb beneath that):

enter image description here

Seashore, SimonLeeman, Stern, Weyand, and many others all work fine.

The entire contents of the failing Default.aspx is:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="segovias-abq._Default" title="Web Order Entry" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Order Entry Login Page</title>
</head>
<body>
<form id="form1" runat="server">
    <div>
    </div>
</form>
</body>
</html>

...and the Default.aspx.vb for it is:

Partial Class _Default
    Inherits Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Session("SelectedMenu") = "Home"
        Response.Redirect("../Login.aspx?MemberNo=B1212")
    End Sub
End Class

OTOH, the entire contents of one of the non-failing Default.aspx is:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Weyand._Default" title="Web Order Entry" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Order Entry Login Page</title>
</head>
<body>
<form id="form1" runat="server">
    <div>
    </div>
</form>
</body>
</html>

...and its Default.aspx.vb is:

Namespace Weyand
    Partial Class _Default
        Inherits Page

        Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
            Session("SelectedMenu") = "Home"
            Response.Redirect("../Login.aspx?MemberNo=031")
        End Sub
    End Class
End NameSpace

IOW, except for the namespaces, they seem to be identical. But even when I added what would seem to be the one expected:

Namespace segovias-abq

...it changed nothing; I still get, "Cannot resolve symbol 'segovias-abq'"

After reading this great article I thought about migrating our platform to micro-services architecture.

Our stack is Asp.Net Web API (Rest...) on the server. Angular 2 in the front.

I wanted to make a little proof of concept to check if we should continue down this road.

As for my understanding, I need to take some chunks from our web app and slice it into micro services. As for the beginning, I want to take 2 screens I have, "Users" And "Purchase History" (each of them is too big to be micro service but this is just for the POC) and create each one of them as micro service.

I read that the UI should be part of the microservice, so should I create a new angular two app for each one of them?

If so, should I use rest to call for the rendered HTML?

NOTE: this is for a school project, I would like to know how to go about this. My group members and i will create one hotel using ASP.NET each and what should we do from there?

I am unable to display the gridview row values in the textboxes. I have done this with C# but I don't want postback and update panel. I want it done using Jquery function. It still sounds easy, but the complex part is, I am using 2 panels, 1 having textboxes and the other having the grid. Clicking anywhere on the row should display the row items in textboxes in the other panel (CustomerId might be the clue), hiding the panel with grid. The code is below..

`<asp:Panel ID="Panel1" runat="server" DefaultButton="btnSave">
<table>
    <tr>
        <td>
            <asp:Label ID="lblFname" runat="server" Text="First Name:"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtFname" runat="server"></asp:TextBox></td>

    </tr>
    <tr>
        <td>
            <asp:Label ID="lblLname" runat="server" Text="Last Name:"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtLname" runat="server"></asp:TextBox></td>

    </tr>
    <tr>
        <td>
            <asp:Label ID="lblDesignation" runat="server" Text="Designation:"></asp:Label></td>
        <td>
            <asp:TextBox ID="txtDesignation" runat="server"></asp:TextBox></td>

    </tr>

    <tr>
        <td>
        </td>
        <td> <asp:Button ID="btnSave" runat="server" Text="Save" Width="54px" ValidationGroup="Master" BackColor="Silver" />
            <asp:Button ID="btnDelete" runat="server" Text="Delete" Width="57px" BackColor="Silver" />
            <asp:Button ID="btnFind" runat="server" Text="Find" Width="54px" OnClick="btnFind_Click" BackColor="Silver" />
        </td>
    </tr>
</table>
        </asp:Panel>`

<asp:Panel ID="Panel2" runat="server">
        <table>
            <tr>
                <td>
        <asp:GridView ID="GridView1" runat="server" style="margin-top: 0px" AutoGenerateColumns="False" CellSpacing="5" CellPadding="3" OnRowCommand="GridView1_RowCommand">
            <Columns>
    <asp:TemplateField HeaderText="First Name" HeaderStyle-Width="150px"> 
           <ItemTemplate>
                 <asp:LinkButton ID="LinkButton1" runat="server" CommandName ="FirstName" Text='<%#Eval("FirstName") %>'  CommandArgument='<%#Eval("CustomerId") %>'  OnClientClick='<%#Eval("CustomerId","javascript:return sel({0});")%>'/>
           </ItemTemplate></asp:TemplateField>
                         <asp:TemplateField HeaderText="Last Name" HeaderStyle-Width="150px">
                             <ItemTemplate>
                 <asp:LinkButton ID="LinkButton2" runat="server" CommandName ="LastName" Text='<%#Eval("LastName") %>'  CommandArgument='<%#Eval("CustomerId") %>'/>
           </ItemTemplate>
                         </asp:TemplateField>
                         <asp:TemplateField HeaderText="Designation" HeaderStyle-Width="150px">
                             <ItemTemplate>
                 <asp:LinkButton ID="LinkButton3" runat="server" CommandName ="Designation" Text='<%#Eval("Designation") %>'  CommandArgument='<%#Eval("CustomerId") %>'/>
           </ItemTemplate>
                         </asp:TemplateField> </Columns>
            <HeaderStyle BackColor="#CCCCCC" BorderColor="Black" />

        </asp:GridView>
               </td>
                     </tr>
            <tr>
                <td> <asp:Button ID="btnBack" runat="server" Text="Back" OnClientClick="JavaScript: window.history.back(1); return false;" /> </td>
            </tr>
       </table>
       </asp:Panel>

I am running an ASP.NET 4.0(C#) application in IIS 6.2 as well as Hosted on Shared Server. When multiple people working same time session will expires without ideal, but when single people working it will never expires even after 15-20 min ideal. I have done the following

set in web.config
Set session timeout to 60 minutes in IIS manager/Web site 

properties/ASP.NET configuration settings Set idle timeout to 60 minutes in application pool properties/performance.

<sessionState mode="InProc" cookieless="false" timeout="60" />

My codes,

Set Value to Session On Login

Session["UserId"] = Convert.ToString(dt.Rows[0]["UserId"]);

Check value of Session of Page Page_PreInit

if (Session["UserId"] == null)
{
       Response.Redirect("~/Index.aspx");
}

Get Value of Session On Page When Requered

string UserId = Convert.ToString(Session["UserId"]);

When Multiple People Loggedin and working On Page_PreInit event Session["UserId"] will be Null and redirected to Login Page as per code. But when single person working or using Session will never becomes Null, even after 15 min Ideal. I don't know what i did wrong?

I am getting this Error: 'ASP.presentation_show_gridview_aspx' does not contain a definition for 'GridView1_RowUpdating' and no extension method 'GridView1_RowUpdating' accepting a first argument of type 'ASP.presentation_show_gridview_aspx' could be found (are you missing a using directive or an assembly reference?)

This is myCode: