13,153 Topics
| |
I havent tried the EnableSortingAndPagingCallbacks property of the GridView before. Appearantly it doesnt do anything different than the updatepanel. It only reduces the mark up used to create the updatepanel, in other words, it encapsulates the functionality. | |
Markup : <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!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>Server Info</title> </head> <body> <form id="form1" runat="server"> <div> <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Caption="Environment Variables"> <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" /> <RowStyle BackColor="#EFF3FB" /> <EditRowStyle BackColor="#2461BF" /> <SelectedRowStyle … | |
Modify the web.config as follows : <configuration> <system.web> <authentication mode="Forms" /> </system.web> <location path="myRestrictedPage.aspx"> <system.web> <authorization> <deny users="?"/> <allow users="*" /> </authorization> </system.web> </location> </configuration> | |
Create a Web form : <%@ Page Language="C#" AutoEventWireup="true" CodeFile="WorkerProcessInfo.aspx.cs" Inherits="WorkerProcessInfo" %> <!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>WorkerProcessInfo</title> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager runat="server" ID="scrpt"></asp:ScriptManager> <asp:UpdateProgress runat="server" ID="uptPrg" AssociatedUpdatePanelID="upt"> <ProgressTemplate> Loading... </ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel runat="server" ID="upt"> <ContentTemplate> <asp:GridView AutoGenerateColumns="false" ID="GridView1" … | |
In c# there is a built-in split method with which you can create a substring array seperated by one character from a string as follows : // string seperated by colons ';' string info = "mark;smith;123 csharp drive;toronto;canada"; string[] arInfo = new string[4]; // define which character is seperating fields … | |
When working with reference types, sometimes you want to add some items to one list which has been assigned another list by reference. When you add new items to your new list, the previous list also gets added the new items since they refer to the same object collection in … | |
in the Page_Load event of the content pages remove the attached eventHandler if there is any, register new eventHandler to the specified event of the controls. in the content page : protected void Page_Load(object sender, EventArgs e) { WebControlType myControl = (WebControlType) Master.FindControl("WebControlID"); // Removes the Handler myControl.SpecifiedEvent -= theDefaultEventHandler; … | |
I have an updatepanel control in the middle of a page, and i have a link at the top of the same page. I refresh the updatepanel by clicking the link ;however, i want the updatepanel to scroll intoview as well. My javascript scrollintoview method didnt work because updatepanel tries … | |
When you use datalist setting its repeatColumn property to a constant number, its height depends on its datasource. Sometimes we want to display 10 item in one column and start a new column next to it. For these occasions i created a function as follows : // in my case … | |
For small applications it is proper to use AccessDataSource object in order to access the database directly from asp.net page. When i first used it for inserting data with formview, it generated the following error : "You tried to assign the Null value to a variable that is not a … | |
Im using VS 2005 for web application.Im using message boxes but they are not working.i dont know what's the problem with my code. [CODE] if (drff.Read()) { Button_Assign.Attributes.Add("onclick", "javscript:alert('Data saved successfully.')"); } /*else { //Button_Assign.Attributes.Add("onclick", "javscript:alert('Data not saved.')"); } [/CODE] my data is saved successfully but im not getting the … | |
sql cache dependency allows for cached data to be evicted and refreshed when it becomes stale. Basically ASP.NET checks for the changes in the datatable in sql server, if it finds one, it refreshes the cached data. Polling based sql cache dependency is very easy to configure as follows : … | |
Today I came across to one thread asking for a help to scroll the page so that it displays error Panel. then i decided to create two generic methods in the utility class of my project as follows : if the button is a postback button : public static void … | |
Today i learned an amazing facility of asp.net 2.0 dropdownlist's. In the past( last year actually ) when i wanted to insert a static item having a text "please select something" i used to follow two ways : either insert an item to dropdownlist's datasource or directly insert an item … | |
Hello everyone, I was wondering if anyone could tell me how to connect and query sql databases in ASP.NET Using C# code I try to use this code, but there is some mistake in the code lead to an error message You must first withdraw from sqlDataadapter toolbar to connect … | |
How to create watermark image at runtime in c#? I dont want any unnecessary codes, i want easy, clear and short block of code if possible. Thanks in advance. | |
i search for a ready script for smooth scrolling but i couldnt find any. So i did it myself as follows, it works perfectly function elementPosition(obj) { var curleft = 0, curtop = 0; if (obj.offsetParent) { curleft = obj.offsetLeft; curtop = obj.offsetTop; while (obj = obj.offsetParent) { curleft += … | |
I have a form that is classic asp that basically collects some info and sends it to an email account. What I really to do is have an email reminder option added. The form is a monthly report and the idea is to have an option for the reminder. The … | |
hi, im using VS.net 2005 for developing a web application.im using stored procedure for inserting records into database.i want to insert time and task for a selcetd employee but its not working. kindly help me.her's my stored procedure: [CODE] create PROCEDURE [dbo].[AssignAndStore] -- Add the parameters for the stored procedure … | |
Hi Friends, I have a GridView in which the row or the data is getting selected on the checkbox click. I want to enable paging in the GridView such that when i go to next page then the previuos selection remains as it is...means i can perform operations on current … | |
I have created a class that returns a class object which have info about the username,pwd,emailid of current user. Now i want to use this email id in my aspx.cs page to show the current logged in user and its email id.... i m creating an isntance of that class … | |
hi every 1 I am working at my graduation project using ASP. net and I want to know if it is possible to search my data base to get specific data and if it so could you tell which is the best way to do so and if you know … | |
Hello everyone, I recently installed VS 2005 and VS 2003 on my Win XP Pro (IIS 5.1). Now, I have two applications, one was written using VS 2005 and the other was written using VS 2003. The problem begins when I try to debug my VS 2003 app. The debugger … | |
hii,,guys,,i m using asp.net2005 and sql server 2005...in my page i have used gridview and sql datasource,i m able to edit,update and delete the records,,the problem is tht for 1 column i would lik to use a dropdown list instead of textbox when i am in edit or update mode,,,heres … | |
I created a javascript function [B]FnNextQuestion()[/B] but I have a problem calling it in my C# class. Is there a way to call this function inside my aspx.cs class? I need help please... | |
Hi, I was wondering if anyone has the solution to this. Let's say I have a dropdownlist. And if a particular value of that dropdownlist is selected, I display a textbox. So I set the dropdownlist to cause a postback event, and on the pageload (when postback), i check to … | |
I have an application that was written for me by a programmer who represented VFP as the "best thing since sliced bread" and that would be robust for many years in the future and more importantly handle huge customer databases over a LAN instantly. Now, after two years the server … | |
Hey guys, I'm developing a quiz engine. Each quiz has 20 questions each of which has multiple choices. Now I've used a DetailsView in which i've taken 4 template fileds for radiobutton. These radio buttons are bound to the text property by corresponding field in the table. I'm able to … | |
I want to develop a LAN Messenging Software which will work just like Yahoo messenger i.e it must give chatting facility + Video + offline messages + online messages +sound/vedio conferencing + we can send and receive messages/tokens from server to client and client to server it must b a … | |
hi hope you all ok. this block is in a for each statement. [CODE]TextBox tb = new TextBox(); tb.Text = rowData[key]; cell.Controls.Add(tb);[/CODE] I need these textboxes (which are created at runtime) to be required user entry fields. Bear in mind i know how to do this with asp.net, I am … |
The End.