|
I thought you set up the DataItemIndex on the grid to be a unique ID for that row.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi Christian,
Thank you for you reply. I am sorry but I did not understand the reply......
The issue is deleting any row from the grid when gridview is shown in the page.
I am trying to programmatically call the delete with code behind.
Thank you,
Sanjeev.
Sanjeev
|
|
|
|
|
A row on a gridview has the property I pointed out, it's purpose is to store a key that you can use to make a database call that identifies that row.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
i am developing a portal using webparts.
i my design i use only one page(index.aspx) and load its content dynamically as webparts based on querystring.
assume that i have two webparts(webpart1, webpart2) in my application.
when the querystring is http://mysite.com/index.aspx?pageID=1
i should load webpart1 into page and when the querystring is http://mysite.com/index.aspx?pageID=2
i should load webpart2 into page.
when i edit each webpart's properties by switching to editmode of webpartmanager , the changes remain on the webpart until i close the browser and by openning new browser ond going to that page the webpart properties value show their default values not recent values.
what should i do?
|
|
|
|
|
I am building in some ajax functionality on my webpage, but I'm not using any frameworks (nor do I want to).
SO here's what I want to do. I'm trying to make a sort of edit-in-place thing on my site. So if you're signed in you can just click an "Edit" link and then it will show a page w/ a textarea and a save button. I have all this done already.
If I was on the products.html page when I clicked "Edit" I want to pass "products.html" back to the server and have the server send back to me the source of the products.html page - as it is on the server. I want to do this asp.net/C# on the server, can I do this? I want to call a function in a aspx.cs file asynchronously.
SO then, the server will come back with the source of the products page and I will fill the text area with that. Then the user can edit the source and then click the save button. This will send the source back to the aspx.cs method, which will physically save it to the server.
So, how can I call a asp.net method asynchronously with javascript/ajax?
/\ |_ E X E GG
|
|
|
|
|
|
We've developed a web app that uses .net 2.0. My boss wants us to create a flash context-sensitive help system using robohelp X5. I've created some test help files (okay, "some" is not the right word - robohelp created 154 files for this - and only three of those files were actual content pages).
In any case, I put the following line in the master page:
<link rel="text/javascript" href="bin/FlashHelp/RoboHelp_CSH.js" /><br />
and then I put this code in for the help link:
[a class=\"HLinksFont\" href=\"javascript:RH_ShowHelp(0, './bin/FlashHelp/john_test_flash_01.htm', HH_HELP_CONTEXT, 1);\"]HELP [/a]
(I had to replace the pointy brackets with square ones so the oce would display - so much for the code tag, eh?)
Items of note:
1) The indicated js file is in the directory shown above.
2) I didn't misspell anything in the link tag
3) The function I'm claling in the second code snippet exists in the js file I'm linking to.
Result - IE tells me that an object is expected at line/char 1 in default.aspx. What am I doing wrong?
[EDIT]
RESOLUTION
It seems that you can't put files into the bin folder and access them from the web page. When I moved the folder containing the help files into the page root folder (and modified the vraious path specifications in the web page files), everything worked as expected.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi,
i want some help with exporting detailsview to excell.I m working on a web application and i have a search page and a result page.The result page demonstrates the results of the search in a detailsview and i want to export it to excell.I use a button for that, the code of the button is :
protected void Button1_Click(object sender, EventArgs e)
{
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
Response.Charset = "";
// If you want the option to open the Excel file without saving then
// comment out the line below
//Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = "application/vnd.xls";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
DetailsView1.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
}
But i have an error message :
"RegisterForEventValidation can only be called during Render();
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: RegisterForEventValidation can only be called during Render();"
Any ideas?????It's very important
Thanks galatia
galatia
|
|
|
|
|
|
I am building a site (using Visual Web Developer and C#) that uses master pages to display content pages (defined in .aspx files) in defined contentplaceholders.
One master page displays either content page A or B. I would like to develop a second master page that displays both A and B in separate ContentPlaceHolders.
How do I link an aspx content page to contentplaceholders in more than one master page?
Any help appreciated!
Jell
|
|
|
|
|
I believe you have the concept reversed. You don't assign content pages to master pages but rather assign a master page to content pages.
only two letters away from being an asset
|
|
|
|
|
Mark,
Thanks for your reply.
You are are right, every content page has to say which master page (and which placeholder(s)) it is assigned to, but that is the root of the problem.
The assignment is done within the content page (using MasterPageFile=xxx in the page directive), and you can only specify one master page. So if I want to use the same content page in different master pages then I am stuck, as this would require two master page assignments in the page directive.
I appreciate that I could copy all the content page code into a separate file, with a different master page assignment, but that seems inelegant and prone to errors.
Jell
Jell
|
|
|
|
|
You don't.
Make the content pages into user controls, and create two sets of content pages that displays the user controls.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa,
This was the answer I needed - works a treat!
Thanks for your help.
Jell
Jell
|
|
|
|
|
Hey guys I have to get the basics of asp using vb.net within the next 3 days...I should be able to do it...I have learned 12+ languages, and I already know VB.Net...Im just having some trouble with designing the forms, How do I place controls where I want them? If you have any sugestions please let me know.
Thank You!
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
When you are looking at your website in the designer (the .aspx not the .aspx.vb) you can look at either the design or the source. You can toggle between the two views by clicking on either "design" or "source" at the bottom left of the screen. The source view shows the html of the page. You will want to use html to create tables to oranize your controls on the page.
Here are some sites that might help you with html:
The Bare Bones Guide to HTML[^]
Tables in HTML Documents[^]
HTML Tag Quick Reference[^]
|
|
|
|
|
Polymorpher wrote: I have to get the basics of asp using vb.net
You can't do asp with VB.NET, you can however use it for asp.net
I'd recommend this book Teach Yourself ASP.NET in 24 Hours[^]
Then you would have two whole days to read How to get an answer to your question
3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
only two letters away from being an asset
|
|
|
|
|
LOL, sry about that...guess I got in a bit of a rush. Thanks for the link, this looks like what I'm looking for.
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
Does anyone know where I can find sample master pages ?
Its more the look & feel that I'm trying to find - I'm OK with producing the code, its the colors, fonts & icons that I always have problems with.
Thanks
|
|
|
|
|
|
Hello,
I am trying to create a custom email class but this one is the first class I create.
Where can I find some tips of how to create classes?
I have various problems. For example, there are properties which, when not defined by the user it won't be used on my code:
Public WriteOnly Property Priority() As System.Net.Mail.MailPriority
Set(ByVal value As System.Net.Mail.MailPriority)
If _Priority = value Then
Return
End If
_Priority = value
End Set
End Property
Is the user doesn't set Priority then in my function I will not have:
email.Priority = ...
Of course I could use an IF condition around "email.Priority = ..." but I am not sure if that's the way.
Thanks,
Miguel
|
|
|
|
|
Set Priority = System.Net.Mail.MailPriority.Normal as the default and use it regardless of whether the user sets it differently.
only two letters away from being an asset
|
|
|
|
|
Another way you could handle this situation is to not have priority as a property but as an optional parameter for the method or function that ends up actually sending the email. Optional parms have to the last parms of the method and have to have a default set. The method header would look something like this:
Public SendMyEmail(ByVal strEmailMessage as String, Optional ByVal strPriority as System.Net.Mail.MailPriority = Net.Mail.MailPriority.Normal)
(Of course, you would probably have a number of other parms before the optional one like who the email is to be sent to, from, CC, BCC, and so on.)
Hope this gives you some ideas to work from.
|
|
|
|
|
i installed an asp.net application onmy machine and tested it and works fine it connected to my access database and retrieve the files correctly. but when i tried to access the website from another machine this works ok too except when i try to connect to the database to capture data i get the following error
Exception Details: System.Data.OleDb.OleDbException: Cannot open database, it may not be a database that your application recognizes, or the file may be corrupt
the source error: points to my code that connects to my password protected database and retrieves soem data
???? is it that i need to try and instal mdac on the pc i am using to browse via the network ????
kenny
|
|
|
|
|
Hello,
I want to send a HTML page of my web site by email.
Is this possible in Asp.Net 2.0?
Thanks,
Miguel
|
|
|
|