DataGrid Paging...All Web Examples Wrong?!


gang,

I'm just now looking at getting paging to work in my datagrids. Here's my problem though:

I have a whole bunch of examples I've found online that all basically look the same: you create a BindData sub, call it in your form load, and call it in your PageIndexChanged event. these examples claim that the .NET framework will handle the CurrentPageIndex change and bind the datagrid accordingly, but it doesn't work! Frustrating...

My code is basically word for word what there's is, except that I'm in vs.net and they were doing it with a text editor (old school asp-like). Anybody have some tips on how to get paging to run right from within vs.net
Posted On: Wednesday 2nd of January 2013 02:29:38 AM Total Views:  368
View Complete with Replies

RELATED TOPICS OF ASP.NET PROGRAMMING LANGUAGE




Crystal report by passing value from textbox/dropdown list

, I like to generate crystal report by passing parameter. I have generated static report but Now I'm in need to generate a report by matching textbox value with backend database and accordingly generate the report. For instance if somebody wants to know who was present in office on 2-3-2010 and he enters the date into the search textbox and enters then names of all those who were present in office shall be retrieved from database and displayed in report.... Please guide me step by step ..... I don't know how to match the textbox value with crystal report
VIEWS ON THIS POST

376

Posted on:

Friday 16th November 2012
View Replies!

Retrieving Checkbox out of a Gridview (SOLVED)

, I've got a gridview and I have a template column that has a checkbox control inside. When I render the gridview, I want to color other columns based on whether or not that column is checked. Here's the code I've written trying to do so: protected void GridView1_OnRowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { CheckBox chkBox = (CheckBox)e.Row.FindControl("tmpChkMath"); if (chkBox != null && chkBox.ID == "tmpChkMath" && chkBox.Checked) e.Row.Cells[(int)ColumnIndices.MathScore].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Green); else e.Row.Cells[(int)ColumnIndices.MathScore].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.Red); } } and here's the asp pertaining to the gridview: ...and so on The issue is, the Checked property of chkBox is always false, even when the checkbox in the gridview is checked (by the way, this column is just populated from a query, it's not editable or anything). I think the problem lies in the FindControl() method. I've scoured the net and found some people with the same problem, but no solutions :\.
VIEWS ON THIS POST

227

Posted on:

Friday 16th November 2012
View Replies!

html page calls default.aspx.vb and gets Ispostback false

I have an asp html page that allows the user to input data into a web page. When they click the submit button it calls a default.aspx.vb. The ISPostback is always false so it skips my sql add parameters. Here is the code: GDR Request Form jQuery(document).ready(function ($) { $("#txtCommercial").mask("(999) 999-9999"); }); Commercial: DSN: **************************************************** Default.aspx.vb **************************************************** Imports System.Data.SqlClient Imports System.Data Partial Class _Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _ Handles Me.Load txtRequester_Date.Text = Date.Today txtRequestDate.Text = Date.Today If (IsPostBack) Then ' this creates the connection. Dim sqlConn As New SqlConnection("Data Source=JITC-PC\GEOINT; Initial catalog=DEV_GEOINT; Integrated Security=SSPI;") ' create the command object Dim sqlCmd As New SqlCommand("sp_InsertRequest", sqlConn) ' define the connection for the command object sqlCmd.Connection = sqlConn sqlCmd.CommandType = CommandType.StoredProcedure ' define the SQL parameter sqlCmd.Parameters.AddWithValue("@Org", txtOrganization.Text) sqlCmd.Parameters.AddWithValue("@REQ_Date", txtRequester_Date.Text) ' open the connection sqlConn.Open() ' execute the data insertion sqlCmd.ExecuteNonQuery() ' close SQL connection sqlConn.Close() ' dispose of the connection object (mostly optional but good practice) sqlConn.Dispose() ' Notify the submission was accepted Response.Write("Thank-you for your Request!") End If End Sub Private Function isempty(ByVal p1 As Object) As String Throw New NotImplementedException End Function End Class This post has been edited by Dormilich: 21 October 2012 - 01:18 AM Reason for edit:: fixed code tags
VIEWS ON THIS POST

350

Posted on:

Thursday 22nd November 2012
View Replies!

How to check the datetime of the QueryString and do the required opera

hi!! i need to check the datetime of the QueryString.... eg- from page1. and on page 2's page load event i need to check whether it is greater than than current datetime...if yes i need to call a method from the button click event else display the error message:this link has expired... below is the code which i have written for page2's page load event.... protected void Page_Load(object sender, EventArgs e) { string keyvalue = Request.QueryString["token"]; DateTime current = DateTime.Now; } can anyone please help me... thank's in advance..... : ) This post has been edited by Dormilich: 03 April 2012 - 02:22 AM Reason for edit:: please use [code] [/code] tags when posting code
VIEWS ON THIS POST

186

Posted on:

Friday 23rd November 2012
View Replies!

Show a PopUp image in page_load

Hi all.I am trying to do something like this: When a user opens my website, in my Page_Load of Default.aspx, I want to show a PopUp window with an image(that I will take from database).If user clicks 'X' button PopUp window will close. I tried extender of AJAX- ModalPopUpExtender but as I saw this is not a control itself but this is an extender for a control that fires an event(for example a button,linkButton,ImageButton etc) and I think this won`t work as a control(wich I would call from Page_Load event of my page,something like modalpopUp.Show() ). I hope you understand and you can help me. Thank You.
VIEWS ON THIS POST

178

Posted on:

Friday 23rd November 2012
View Replies!

session creation in asp.net

[description]session creation in asp.net[/description]
VIEWS ON THIS POST

201

Posted on:

Friday 23rd November 2012
View Replies!

add Controllers GridView Dynamically

i have DataTable object and i put data into it by Creating DataRow take from dataset and finally i set the Gridview that DataTable what i want is i want add controller like link button into DataTable dynamically so then i can view those in gridview. i want see these controller not all the rows so i have to dynamically add those. so if any one knows how to add controllers into datatable dynamically please help me.
VIEWS ON THIS POST

372

Posted on:

Friday 23rd November 2012
View Replies!

I just want a URL parameter grabbed...

(I think this is asp, not asp.net if that matters.) I have an image that I'm displaying as The url is images.aspimg=1 I want #.jpg to show as 1.jpg. I'm usually a php user and I'm just doing this for work which is why I have no idea how to do this. I've done some googling and the only thing I come across is huge amounts of code. Shouldn't there be an easy command to just grab what's in the URL's img parameter
VIEWS ON THIS POST

122

Posted on:

Friday 23rd November 2012
View Replies!

how to design a screen for different screen resolutions

I have a webpage developed using VB.net when i run the webpage in different screen resolution i see some blankspace left in the right side corner of the screen(webpage).Can you help me to fix this issue. want to know the solution to make the screen look fit in all screen resolutions..
VIEWS ON THIS POST

192

Posted on:

Saturday 24th November 2012
View Replies!

Text Box options for C#/ASP.Net

I am currently writing an application for my children. The idea of the application is to have 8 dropboxlists which are bound to a word database. Each dropbox represents a list of a "type" of word and each type is in a different color. For instance the first drop box is for nouns and the nouns are in purple. When a word is selected in a dropbox I would like it to be added to a textbox in the same color as the word type they chose. I also need it to change the first letter of any word following a period to a Capital letter. I started out with a regular textbox forgetting, of course, that it doesn't allow a word to be a specific color but rather all words stay the same color. I had it working but then realized I really needed the colors for my idea to work. So I decided I needed a richtextbox but this type of control is not supported on c#/ASP.Net applications unless you get a WYSIWYG editor, which I did. I got tinymce. The problem is that I don't know javascript at all. I have looked through but cannot figure out how to add a selected item from a C#/ASP.Net code-behind to a textbox transformed into a richtext box in Javascript. I do have a richtextbox where my regular text box used to be but I have the following problems: The text box is in the middle of the page and not where I set the position to be. I cannot change it no matter how many times I have changed the top, left, width, height px. Every time a dropdownlist word is selected the word is posted on the richtextbox but they are not going across the page like you are writing it but rather are listing the words one on top of another. I have set the color to change with each selection but instead it flashes the word the set color and then changes it to black again. My questions are these: Does anyone have any idea around the WYSIWG editor Is there another control that I could be using that wouldn't cause so much trouble. Am I missing something here...Besides knowledge in Javascript. Thank you for your time! If you want to see the code I would be happy to provide it. I just don't really want to get into the code. I just want suggestions on how to proceed.
VIEWS ON THIS POST

153

Posted on:

Saturday 24th November 2012
View Replies!

Drag and Drop in ASP.NET

I was wondering if anyone had any useful links or some helpful hints on how to use drag and dropping in ASP.NET. I know it says you won't do my homework for me and i'm not asking someone to write code for me. Just looking for something to start with. I'm basically looking to drag an item to a certain area and drop it, which in turn will execute a piece of code like ajax or something of that nature. If anyone has any useful links or suggestions it would be greatly appreciated.
VIEWS ON THIS POST

101

Posted on:

Saturday 24th November 2012
View Replies!

where do i start

thank you re; http://www.speedway.co.nz i am an absolute begginnner i use dreamweaver 4 to do what i can. My son inlaw got the menue working, other than that im on my own. i delevoped the site as an enthusiast I now have the problem that the "office" want to update some of the info on the site themselves. the office wants to update things like the results pages i do not know where or how to start how do i prepare pages to accept information from some other place what is the most common way of "the office" sending the information to the page once i have prepared the page
VIEWS ON THIS POST

177

Posted on:

Saturday 24th November 2012
View Replies!

can use timestamp in asp.net?

can use timestamp in asp.net,if use meeans,how it use in asp.net.
VIEWS ON THIS POST

140

Posted on:

Sunday 25th November 2012
View Replies!

user control compile error.

I'm getting the following error Value of type 'Integer' cannot be converted to 'System.Web.UI.Page'from VS generated code which appears to be for my datalist.Code:Private Function __BuildControldlProducts() As Global.System.Web.UI.WebControls.DataList\t\t' edited down\t\t\t\t\t\t#End ExternalSource\t\t\t\t\t\tMe.dlProducts = __ctrl\t\t\t\t\t\t__ctrl.ApplyStyleSheetSkin(Me.Page) '
VIEWS ON THIS POST

192

Posted on:

Sunday 25th November 2012
View Replies!

cancel download causes no other responses

,\t\tI'm having an issue with a few sites that I'm building for work. Basically It's an HTTPS File transfer site. I'm having intermittent problems with the download page where if I start a download of more than about 4 MB, then once I have chosen a download location and the file starts coming through then I press Cancel. After this anything else that I click doesn't seem to want to work at all. The little animation in IE starts turning but nothing ever happens after this. Any downloads that I don't cancel, complete successfully and I can download another file after that it's only a problem when cancelling or even trying to download two at once. \tThe method I'm using to process the downloads is, I guess you could call it a chunked download, using a binary stream through the Response.OutputStream to write chunks of the size 8192 to the outputstream. This is the best way that I've found to do any of this cause it doesn't use much of the server's memory to process larger downloads along with the fact that you can push virtually any file to force it to download rather than directly linking to files and having them open in the browser. Here's a sample to give you an Idea of what I'm talking about:Code:\t\t\t\t\t\tPage.Response.BufferOutput = False\t\t\t\t\t\tPage.Response.AddHeader("CONTENT-DISPOSITION", "attachment; filename=""" & f.Name & """")\t\t\t\t\t\tPage.Response.AddHeader("CONTENT-LENGTH", f.Length)\t\t\t\t\t\tPage.Response.ExpiresAbsolute = Now.AddSeconds(-1.0)\t\t\t\t\t\tDim st As System.IO.Stream\t\t\t\t\t\tst = Page.Response.OutputStream\t\t\t\t\t\tDim lLength As Long = f.Length\t\t\t\t\t\tDim lCurrentPos As Long = 0\t\t\t\t\t\tsw = New BinaryWriter(st)\t\t\t\t\t\tfs = f.OpenRead()\t\t\t\t\t\tDo Until lCurrentPos = fs.Length\t\t\t\t\t\t\t\tIf Page.Response.IsClientConnected Then\t\t\t\t\t\t\t\t\t\tDim b(8192) As Byte\t\t\t\t\t\t\t\t\t\tfs.Seek(lCurrentPos, SeekOrigin.Begin)\t\t\t\t\t\t\t\t\t\tfs.Read(b, 0, 8192)\t\t\t\t\t\t\t\t\t\tsw.Write(b, 0, b.Length - 1)\t\t\t\t\t\t\t\t\t\tlCurrentPos = fs.Position\t\t\t\t\t\t\t\tElse\t\t\t\t\t\t\t\t\t\tbDisconnect = True\t\t\t\t\t\t\t\t\t\tExit Do\t\t\t\t\t\t\t\tEnd If\t\t\t\t\t\tLoopHas anyone had this problem of cancelling a download using this or any other similar methodPLS help!
VIEWS ON THIS POST

257

Posted on:

Sunday 25th November 2012
View Replies!

DataGrid/Checkbox doesn't reflect client-side changes

I have a DataGrid (ID=DataGrid1) and a PlaceHolder on an aspx page. In the Init phase of the page, I dynamically add a template column containing a CheckBox to DataGrid1. In the Load phase of the page, I instantiate a DataGrid (ID=DataGrid2), add a template column containing a checkbox to that grid and then add the DataGrid to the placeholder. The 1st time the page is hit, no CheckBoxes are selected in either grid. Using my browser, I select a CheckBox in both of the grids, then navigate to another page in one of the grids, forcing a postback to the server.My server code checks to see if any of the CheckBoxes are checked within either of the grids. I perform this check in 2 phases of the page lifecycle: 1: Page_Load (after adding DataGrid2 to the PlaceHolder on the page)2: the event handler for the clicking on a page of the DataGrid. For DataGrid2, the CheckBox reflects my client-side check only in case #2, whereas DataGrid1 reflects my client-side check in both case 1 & 2. It is my understanding that when a control is added to a page, it plays catch-up within the page life cycle until it reaches the current phase of the page. Since the page is in the Load phase when I added DataGrid2 to it, DataGrid2 should have loaded its PostBack data and thus reflect the client-side change I made by the time I scan the CheckBoxes.Does anyone know why my CheckBoxes do not reflect client-side checks I made within DataGrid2 within Page_Load
VIEWS ON THIS POST

221

Posted on:

Sunday 25th November 2012
View Replies!

Cookies in ASP.NET

Quick question. I am changing over the secure areas of all of our websites into a single URL (secure.mycompany.com), but the way things are set up now is that when, say, a user logs in on our site, the cookie is made on a different web site (example: theproduct.com). We have a function on the secure page that checks to see if the cookie is there, and if it isn't then it doesn't display certain information properly. Is there anyway for the other web site (the secure one) to find and use the cookie that the product's website created If not, I may just move the login pages over and put those on the secure page as well if necessary.
VIEWS ON THIS POST

209

Posted on:

Sunday 25th November 2012
View Replies!

printing

I have used the example off the web for printing a textfile to a network printer.This does not seem to work, i dont think it can find the network printer by default.does anybody know what i need to be doing.Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click\t\t\t\tTry\t\t\t\t\t\tstreamToPrint = New StreamReader("test.txt")\t\t\t\t\t\tTry\t\t\t\t\t\t\t\tprintFont = New Font("Arial", 10)\t\t\t\t\t\t\t\tDim pd As PrintDocument = New PrintDocument\t\t\t\t\t\t\t\tAddHandler pd.PrintPage, AddressOf Me.pd_PrintPage\t\t\t\t\t\t\t\tpd.Print()\t\t\t\tFinally\t\t\t\t\t\t\t\tstreamToPrint.Close()\t\t\t\t\t\tEnd Try\t\t\t\tCatch ex As Exception\t\t\t\t\t\tlblMessage.Text = ex.Message\t\t\t\tEnd Try\t\tEnd Sub\t\t'////////\t\tPrivate Sub pd_PrintPage(ByVal sender As Object, ByVal ev As System.Drawing.Printing.PrintPageEventArgs)\t\t\t\tDim linesPerPage As Single = 0\t\t\t\tDim yPos As Single = 0\t\t\t\tDim count As Integer = 0\t\t\t\tDim leftMargin As Single = ev.MarginBounds.Left\t\t\t\tDim topMargin As Single = ev.MarginBounds.Top\t\t\t\tDim line As String = Nothing\t\t\t\t'Calculate the number of lines per page\t\t\t\tlinesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)\t\t\t\t'Print each line of the file\t\t\t\tWhile count < linesPerPage\t\t\t\t\t\tline = streamToPrint.ReadLine()\t\t\t\t\t\tIf line Is Nothing Then\t\t\t\t\t\t\t\tExit While\t\t\t\t\t\tEnd If\t\t\t\t\t\tyPos = topMargin + count * printFont.GetHeight(ev.Graphics)\t\t\t\t\t\tev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, yPos, New StringFormat)\t\t\t\t\t\tcount += 1\t\t\t\tEnd While\t\t\t\t'If more lines exist, print another page\t\t\t\tIf Not (line Is Nothing) Then\t\t\t\t\t\tev.HasMorePages = True\t\t\t\tElse\t\t\t\t\t\tev.HasMorePages = False\t\t\t\tEnd If\t\tEnd Su
VIEWS ON THIS POST

250

Posted on:

Monday 26th November 2012
View Replies!

ASP.NET To LINQ

I dont know how to use SP in LINQ\t\t i made sample application for LINQ to Asp.net but use Query.. now i want to insert master- detail data using SPs with LINQ so please help me.....
VIEWS ON THIS POST

157

Posted on:

Monday 26th November 2012
View Replies!

Multiply decimal value according to decimal places

Hi all, I get a value in decimal places after mulytiplying like below: if (Pair == "USD.CHF") { double result1 = result * 0.86; Label3.Text = Convert.ToString(result1); } else if (Pair == "GBP.JPY") { double result1 = result * 135.56; Label3.Text = Convert.ToString(result1); } Now, I need to do that If my result1 comes in 5 decimal places then multiply with 10000. If result1 comes in 3 dp then multiply with 100 Please help!
VIEWS ON THIS POST

146

Posted on:

Tuesday 27th November 2012
View Replies!

project title related asp.net

hi i dont know about asp.net. so i want to learn asp.net. pls send some innovative project title in asp.net. i'll try to code for that and post it to you.
VIEWS ON THIS POST

113

Posted on:

Tuesday 27th November 2012
View Replies!

Change GridView DataSource

Hi all, I am trying to follow a tutorial on template fields but it uses Access and i am using sql sever 2000.how do i change the data source from this to sql server 2000CODE...\t\t\t\t\t\t\t\tI cannot find a tag same as this
VIEWS ON THIS POST

102

Posted on:

Tuesday 27th November 2012
View Replies!

in kiosk-mode can I also disable right mouse click

Hi\tI have an asp.net intranet app. that runs in kiosk modeI was wondering if its possible to also disable the right click button as the menu options which I hide in kiosk mode open up on right click
VIEWS ON THIS POST

186

Posted on:

Tuesday 27th November 2012
View Replies!

web service w/ x509 signing takes forever compared to another

I have three applications on the same server:web service server(app1)web service client(app2)web service client(app3)app2 and app3 retreive the same exact data from app1.\tapp2 and app3 both use https and x509 signing.The problem:app1 retreives the data in a very short amount of time 2-3 seconds.\tapp2 retreives the data in a very long amount of time 12-15 seconds.I cannot figure out why and it is driving me crazy!!!I have tried re-adding the ssl certificate to the certificate store for app2I have deleted and re-created the web site itself in IISThe code is the exact same. The data is the exact same.Can anyone give me some ideas on how I can figure out the difference is
VIEWS ON THIS POST

203

Posted on:

Tuesday 27th November 2012
View Replies!

export data to word

how can i export the data contain in a web form, to an existing word document
VIEWS ON THIS POST

203

Posted on:

Tuesday 27th November 2012
View Replies!

CustomValidator: Can it Fire When Control is Blank

I want a CustomValidator to function sort of as a conditional RequiredFieldValidator. The ClientValidationFunction works, but it will only get called if there is input in the TextBox, and I want it to fire even when there is NO input.Can I do it
VIEWS ON THIS POST

140

Posted on:

Tuesday 27th November 2012
View Replies!

Implementing Security on ASP.NET

all,I'm developing a web site that needs to restrict access to only authenticate users. The content of the site is very sensitve and therefore needs to be very secure. Futhermore, website data is different depending on the user and each user is allowed to see only data that belongs to him. I'm reading about the different methods of security offered by ASP.NET and I'm having problems choosing one because they all seem to have a major flaw. For example, using IIS authentication, I could choose from Annonymous access, Basic authentication, Digest Authentication, and Windows authentication. Out of all these, the one that sounds the best (i.e. the most secure) is Windows authentication, but it can only be used by Windows users and doesn't work over firewalls. ASP.NET's own security model provides different modes of security as well, these being Windows, Forms, and Passport. My book suggests that Windows mode is best suited for Intranets, and that Forms is not very secure, leaving me with Passport as the preferred choice. However, my book doesn't discuss passport and I'm in the process of finding more information about it.Can anyone please suggest what approach I should take. You should probably know that I keep information about each user (large amounts of data) on a SQL Server database and that each user must have access to its own data only. The site must determine what data to pull from the database based on the user's credentials. Please , clear my mind out on this one.
VIEWS ON THIS POST

225

Posted on:

Tuesday 27th November 2012
View Replies!

Storing Dataset in ViewState/Session

I wrote this a few days ago, but I forgot to put in a subject heading and no one replied.Now I'm asking a slightly different question: is it feasible to store a DataSet in a ViewState or Session Variable The reason I ask is that (I figure) some of a DataSet's benifits are lost if you have to re-Fill() the DataSet each time a page loads. I would like to fill it once and then just use it over and over, without having to open a database connection each time.What is the popular opinion on this Would it be a good thing to do, or is the overhead too great to be practicalTo give you an idea of what I'm talking about, here is a page on my site that has to Fill() the DataSet each Page_Load(). It would be easy to move the intialization of the DataSet into the "if (!this.IsPostBack)" section and then to get the object back from the ViewState otherwise.DataSet dataset = null;int position = 0;void Page_Load(Object sender, EventArgs e) {\t\tdataset = new DataSet();\t\tif (!this.IsPostBack) {\t\t\t\tposition = 0;\t\t\t\tViewState["position"] = position;\t\t}\t\telse {\t\t\t\tposition = Convert.ToInt32(ViewState["position"]);\t\t}\t\t\t\tOleDbConnection connection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\inetpub\\website.mdb;");\t\tOleDbDataAdapter adapter = new OleDbDataAdapter("SELECT date, text FROM news ORDER BY id", connection);\t\tadapter.Fill(dataset, "news");\t\tupdateNews();}void prev(object sender, System.EventArgs e) {\t\tViewState["position"] = ++position;\t\tif (!updateNews()) {\t\t\t\tViewState["position"] = --position;\t\t}}void next(object sender, System.EventArgs e) {\t\tViewState["position"] = --position;\t\tif (!updateNews()) {\t\t\t\tViewState["position"] = ++position;\t\t}}private bool updateNews() {\t\ttry {\t\t\t\tlbl_date.Text = dataset.Tables["news"].Rows[position]["date"].ToString();\t\t\t\tlbl_text.Text = dataset.Tables["news"].Rows[position]["text"].ToString();\t\t}\t\tcatch (Exception e) {\t\t\t\treturn false;\t\t}\t\treturn true;}News
VIEWS ON THIS POST

176

Posted on:

Wednesday 28th November 2012
View Replies!

gridview update paramater not passing

First of all, you update command. I think it should beUpdateCommand="UPDATE [litems] SET [qty] = @qty where indx = @indxSecond, your gridview is bound to the data source control, so do not use the control ID of the gridview, instead\tYou may read through UpdateParameters property in the Visual Studio Book online.Here are some text from it.UpdateParameters property gets the parameters collection that contains the parameters that are used by the method that is specified by the UpdateMethod property.The names and types of the parameters that are contained in the UpdateParameters collection must match the names and types of the parameters in the UpdateMethod method signature. Parameters are added to the collection from three sources:1.\t\tFrom the data-bound control, at run time.2.\t\tFrom the UpdateParameters element, declaratively.3.\t\tFrom the Updating event handler, programmatically.First, any parameters that are generated from data-bound controls are added to the UpdateParameters collection. For example, if the ObjectDataSource control is bound to a GridView control that has the columns Name and Number, the parameters for Name and Number are added to the collection. The data type of these parameters is string. Next, the parameters that are listed in the UpdateParameters element are added. If a parameter in the UpdateParameters element is found with the same name as a parameter that is already in the UpdateParameters collection, the existing parameter is modified to match the parameter that is specified in the UpdateParameters element. Typically, this is used to modify the type of the data in the parameter. Finally, you can programmatically add and remove parameters in the Updating event, which occurs before the Update method is run. The method is resolved after the parameters are merged. Method resolution is discussed in the next section.Seaport
VIEWS ON THIS POST

199

Posted on:

Friday 28th December 2012
View Replies!

Gridview Edit Question

,Is there a way to have the edit function of a GridView on an aspx page only allow the user to edit certain cells of the selected rowI currently have the GridView setup and it returns the data from the database (MySQL) and I have setup the autogenerateeditbutton. However when you click on Edit for a row every cell becomes editable and I would just like to have two of the cells editable with the rest staying put displaying their regular data
VIEWS ON THIS POST

172

Posted on:

Tuesday 1st January 2013
View Replies!

Best Practice for DetailsView

Using .NET 2.0 and VS2005 I'm creating a new website and I'm trying to utilise the new controls and features were possible.At the moment I'm making a simple update / add record form and initially tried creating the textboxes and using a ObjectDataSource Control set to a TableAdapter to add the fields. This worked but I can't for the life of me work out how to read a record from the ObjectDataSource and populate the textboxes ready for an edit to occur. I'd still be interested in hearing how to do thisAnyway, so I decided to try the detailsview control. At first I couldn't work out how to validate it and add multiline textboxes, but some time playing with templates has got most of that ironed out. However I'm trying to work out the best practice for updating some default fields in the table that the user should not see in the details view. I have a field for modified date to enable basic auditing of the updates and want to update it with the current date and time when the user clicks the update command in the detailsview. How can I do this / what method is best advice greatly appreciated.Cheers, Steve G (MCP)
VIEWS ON THIS POST

220

Posted on:

Tuesday 1st January 2013
View Replies!

Insert into GridView

I'm designing an app for VB.Net VS 2005 ASP.NET in which users will review and add records to a list.\tTo optimize the UI, I need to be able to insert records into the middle of the list.\tIdeally, there would be a control on one record that would say "insert a record below me".\tWhen the user activated that control, a "blank" record would appear below the record with the control, and the user would fill it in.I recognize that there are lots of other ways to add records to a list, but this is the one that will be optimal in terms of how the user is reviewing and understanding the content.It will look something like this:1:Seq# Content1\t\tAAAAAAA\t\t2\t\tBBBBBBB\t\t\t\t
VIEWS ON THIS POST

210

Posted on:

Tuesday 1st January 2013
View Replies!

Central admin pages

Dear all,I have inherited a bit of a mess.I need to find the central admin pages for Sharepoint to alter the virtual server settings.The link has gone somewhere.Could anyone tell me the page name url pleaseCheers,J ----------------------------------------------------------------------------------------A community development project in asp.net - http://www.whatsthehampton.com/
VIEWS ON THIS POST

225

Posted on:

Tuesday 1st January 2013
View Replies!

Can JS access the controls in a USER CONTROL for client-side events?

In the main ASP.NET page ... if you have a user control ... which say contains several controls like say text boxes for a person's address ....\thow can you use JS to access the text boxes in the User Control.Do user controls support events on the client side that you can use JS to access how do you do thatSay I want to access the client side change event for a textbox within the user control ..... .. I have no problem with the server side events. I want to explore JS for client side processing as well.
VIEWS ON THIS POST

195

Posted on:

Tuesday 1st January 2013
View Replies!

Merge datasets in a datagrid

hi,i have 3 datasets that I want to merge into a single datagrid with collapsible rows(optional!).The 3 datasets contain a single tables which are related to each other by primary key.how can I combine these
VIEWS ON THIS POST

185

Posted on:

Tuesday 1st January 2013
View Replies!

datagrid

I am following a sample on the internet about a hierachical datagrid.For some reason my sample creates all the data as expanded and not collapsed as it shows on this link.Do you know whyhttp://www.dotnetjunkies.com/Tutorial/841522C9-FFBD-4C57-BD48-F62B55057FF3.dci
VIEWS ON THIS POST

113

Posted on:

Tuesday 1st January 2013
View Replies!

How Do You add NameSpace lines to the CodeBehind Module

I've tried to put my code in the CodeBehind module, but when it needs NameSpace lines, e.g., for I/O, I can't figure out where to put them to avoid an error message.\tEvent routines not requiring NameSpace lines are ok.\tCan anyone advise
VIEWS ON THIS POST

471

Posted on:

Tuesday 1st January 2013
View Replies!

How to display the most current date in label.text

I have a\tlast_Plan_Purchase_Date column in my dataset and I would like to display the last purchased date in lblDate.text. I am wondering how I can display the most current date. As you can see in the below code it always pick the first row eventhough it is not the most current date. please help lblDate.Text = dsPhlList.Tables("phldetail").Rows(0).Item("Last_Plan_Purchased_Date").ToString()
VIEWS ON THIS POST

151

Posted on:

Tuesday 1st January 2013
View Replies!

Databinding for a newbie

When switching from asp to aspx, is there a new technique for binding data to a textbox control, or do we continue to use code like:CODEI have gone through the videos that discuss the new data controls such as grid and formview but have seen nothing on using regular textboxs outside of the formview
VIEWS ON THIS POST

168

Posted on:

Tuesday 1st January 2013
View Replies!

printing to a client from an ASP.NET application on the web server

I've written an ASP.NET (VS 2005) application that will print a receipt automatically when a command button is pressed.\tHere is an excerpt of the code that I am using to do this:Dim printFont As New Font("COURIER NEW", 12)Dim pd As New PrintDocument()AddHandler pd.PrintPage, AddressOf pd_PrintPagepd.PrinterSettings.Copies = 2' Specify the printer to usepd.PrinterSettings.PrinterName = "\\awnse01\Generic"If pd.PrinterSettings.IsValid Then\t\tpd.Print()Else\t\tlbError.Text = "Printer is invalid."End IfThe client name is awnse01and server name is webserver1.\tThe printer is installed on uhaditse02 and application resides on webserver1.\tHowever, when I go to print, it will NOT print.The only way it will print is if I turn the client (awnse01) into a web server and run the application locally.\tI then change this line of code to the following:pd.PrinterSettings.PrinterName = "Generic / Text Only"While it works and I can go with this arrangement as a last resort, I'd rather not due to security reasons.\tAnd there is no sense in having more than one copy of this application on the network.How would I allow a program running on the server to control a printer attached to the client\tI tried impersonation and running the program as my personal username.\tI also tried giving permissions to the local printer, but it still did not print.\tCan anyone help\tThis is urgent and any help would be GREATLY appreciated!
VIEWS ON THIS POST

148

Posted on:

Wednesday 2nd January 2013
View Replies!

DataLists and RepeatColumns

I have a datalist set with RepeatColumns=3 and Width=100%.If there are 3 or more items everything displays correctly, meaning each itemtemplate is 33% in width for each row. However, if there are only 2 items, each itemtemplate is 50% in width and if there is only one the itemtemplate width is 100%.Is there a way to force the datalist to not expand the width of itemtemplates if there are less items than specified in repeatcolumns http://www.Morter.comhttp://www.BestLifeTraining.comhttp://www.AbsoluteStudio.com
VIEWS ON THIS POST

113

Posted on:

Wednesday 2nd January 2013
View Replies!

Problem with using dataview as sourced/filter for a datagrid

I have a web datagrid which is using a dataview as its data source. In the designer, the LeadGrid's data source is set to dvLeadSearch. dvLeadSearch's table is set to a dataset.table.\tIt's rowFilter is originally set to "LeadLastName = 'kelly'" in the designer.The first population of the grid works fineI originally reset the RowFilter in the btnLeadSearch_Click sub-routine below.\tBut when I databind in this routine, an empty grid is returned, even if I don't change anything (per example below).This doesn't happen if I set the grid's data source to the dataset vice the dataview. CODEPrivate Sub btnLeadSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLeadSearch.Click\tLeadGrid.DataBind()End Sub
VIEWS ON THIS POST

140

Posted on:

Wednesday 2nd January 2013
View Replies!

retrieve all links of given address

i want to\tenter url into textbox (for example http://www.tek-tips.com) and get to all links that page includes.is there a way to do this Thanx.
VIEWS ON THIS POST

66

Posted on:

Wednesday 2nd January 2013
View Replies!

Why is VS asking for user name and Password to open project

all of the sudden I am getting a prompt for a user name and password to open exisiting ASP projects.The error message isUnable to get project file from web server. The file path does not correspond with the url..the two need to be mapped to the same location. Everything was working fine the other day
VIEWS ON THIS POST

148

Posted on:

Wednesday 2nd January 2013
View Replies!

serving files securely from virtual directory

We are building a client web service which serves very large pdf's. these pdf's are on a file server seperate from our IIS server. they lie in a virtual directory of the IIS server called "PDFS" How do we isolate clients to their files and obscure the path to these files so nobody just guesses random file names to access other peoples files...i.e. www.mydomain.com/PDFS/"typeinrandomname".pdf....our front end only shows the client what PDFS they have and they are transferred to the virtual directory when clicking the link. does anybody have a similar service. The PDFS must lie on the seperate files server as they are very large.any input would be greatly appreciated.
VIEWS ON THIS POST

69

Posted on:

Wednesday 2nd January 2013
View Replies!

client script

If I want to add some client-side script to my ASP.NET page, say for some navigation menus, how should it be added to the page and in what fileI am using Visual Studio.NET where you have code behind.Should it be added directly to the .aspx file or by a some property in the .aspx.vb file.rotsey
VIEWS ON THIS POST

53

Posted on:

Wednesday 2nd January 2013
View Replies!

atoi problem

Guys,I'm an old Visual C++ developer who hasn't use it for about 6 years.\tI am not using C#.net and I have a need to convert a string to int.\tIn C++ it was easy to just atoi.When I try to use atoi in C#.net I get the old familiar "not in namespace" error.\tHere's the piece of code:\t\ttempTimeText = tempDataRow["Hours"].ToString();\t\thours = atoi(tempTimeText); Am I losing it or do I need to add some "using" statement or reference.\tIs my syntax completely wrong\tThe MSDN and TechNet is as helpful as a pay toilet in a poop ward as usual
VIEWS ON THIS POST

160

Posted on:

Wednesday 2nd January 2013
View Replies!

error when paging

i want to allow paging in my datagrid in an aspx page.i am doing this on c#:private void dgrepetidos_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e){\tdgrepetidos.CurrentPageIndex = e.NewPageIndex;}but i get this error when trying to do the databind on the data grid:\t\t"owCustomPaging must be true and VirtualItemCount must be set for a DataGrid with ID dgrepetidos when owPaging is set to true and the selected datasource does not implement ICollection. "how can i solve that problem
VIEWS ON THIS POST

89

Posted on:

Wednesday 2nd January 2013
View Replies!

Loop DropDownList..?

Hi all,I have five dropdownlists on a form. I would like create a loop so that I can reduce the code. Something like:Dim DDList As DropDownList\t\t\t\t\t\tFor intCount = 1 To 5\t\t\t\t\t\t\t\tWith DDList(intCount)\t\t\t\t\t\t\t\t\t\t.DataSource = objDS.Tables(1)\t\t\t\t\t\t\t\t\t\t.DataTextField = ("myText")\t\t\t\t\t\t\t\t\t\t.DataValueField = ("myValue")\t\t\t\t\t\t\t\t\t\t.DataBind()\t\t\t\t\t\t\t\tEnd With\t\t\t\t\t\tNext/Kent J.
VIEWS ON THIS POST

70

Posted on:

Wednesday 2nd January 2013
View Replies!

Problem reading-in data from text file

Hi ,I've been wondering why this isn't working:\tI was curious and wanted to rebuild the old MWSC.NextLink control that shiiped with ASP 3.0 for ASP.NET.\tEssentially, I'm trying to read from a tab-delimited text file (2 columns) and have the values before and after the tab be added to a Hashtable.\tBut for some reason, I eep drawing an ArgumentOutOfRangeException when trying to run the code.\tSpecifically, I get "Length cannot be less than zero. Parameter name: length", indicating that no data's being read-in.private Hashtable GetFileList(string file)\t\t\t\t{\t\t\t\t\t\tHashtable ht = new Hashtable();\t\t\t\t\t\tStreamReader sr = File.OpenText(file); \t\t\t\t\t\t\t\t\t\t\t\t// TODO: somewhere in here the code is going wrong...it works otherwise....\t\t\t\t\t\twhile(sr.Peek() > -1)\t\t\t\t\t\t{\t\t\t\t\t\t\t\tstring contents = sr.ReadLine();\t\t\t\t\t\t\t\t\t\ttabPosition = contents.IndexOf("\n",0);\t\t\t\t\t\t\t\t\t\tbefore = contents.Substring(0,tabPosition);\t// the Hashtable's key\t\t\t\t\t\t\t\t\t\tafter = contents.Substring(tabPosition+1);\t// the Hashtable's value\t\t\t\t\t\t\t\tht.Add(before,after);\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsr.Close();\t\t\t\t\t\t\t\t\t\t\t\treturn ht;\t\t\t\t}Any ideas
VIEWS ON THIS POST

86

Posted on:

Wednesday 2nd January 2013
View Replies!