Striper Talk Striped Bass Fishing, Surfcasting, Boating

     

Left Nav S-B Home Register FAQ Members List S-B on Facebook Arcade WEAX Tides Buoys Calendar Today's Posts Right Nav

Left Container Right Container
 

Go Back   Striper Talk Striped Bass Fishing, Surfcasting, Boating » Striper Chat - Discuss stuff other than fishing ~ The Scuppers and Political talk » Computers

Computers Sidetrack to Computers, Questions on your home computer? Posting just for registered members....

Reply
 
Thread Tools Rate Thread Display Modes
Old 09-30-2007, 10:48 AM   #1
BrianS
Canal Junkie
iTrader: (4)
 
BrianS's Avatar
 
Join Date: May 2003
Location: Raynham
Posts: 1,678
Send a message via AIM to BrianS
Any C# or .NET programmers about?

Here is my dilemma, I am building my firms intranet and I am currently building the admin tools. I am trying to build a tool that allows me to edit the news posts on the front page of the intranet.

I use a gridview to list out the contents of my INT_NewsItems table. Each record is a news post on the front page of the intranet.

I created an EDIT column in the gridview with a hyperlink to a new page passing the ID variable...

basically http:// EditNews.aspx?ID= + ID

On EditNews.aspx I pull the ID variable and use it make a query to populate the page with the information of the record we want to edit/update.

One of the fields we want to update is the IMAGE field. When I create the newsitem I have the ability to upload a picture (using the fileupload) and then I save the path to the database so when the newsitem is viewed, the picture is visible in line rather than as an attachment. For the sake of the EditNews page, I list a hyperlink to the picture and put a button next to it so I can DELETE it if I want. The button works, it points to a delImage function in the CS page, but it only works because I am entering the actual ID of the newitem rather than the ID field...... This is my problem.... I need to know how to pass a variable to the delItem function in the CS page of EditNews.aspx so when I click the Delete button, the ID variable is passed so I can do a query and get the path of the image to delete.

How do I pass/get this variable? Im stumped. All the code is in the EditNews.aspx.cs page. Almost all of the initial population is in the page_load function. I need to pass it to the delImage function with that button.

aim: SaltedBrian
BrianS is offline   Reply With Quote
Old 10-02-2007, 10:20 AM   #2
MrHunters
What was that!?!
iTrader: (0)
 
MrHunters's Avatar
 
Join Date: May 2005
Location: East Kingston, NH
Posts: 3,108
geek.

don't you know. all the great code comes from google
MrHunters is offline   Reply With Quote
Old 10-02-2007, 12:33 PM   #3
BrianS
Canal Junkie
iTrader: (4)
 
BrianS's Avatar
 
Join Date: May 2003
Location: Raynham
Posts: 1,678
Send a message via AIM to BrianS
im long past this part... now im having SQL issues..

Google has been uncooperative thusfar.

aim: SaltedBrian
BrianS is offline   Reply With Quote
Old 10-02-2007, 01:45 PM   #4
striperman36
Old Guy
iTrader: (0)
 
striperman36's Avatar
 
Join Date: Oct 2004
Location: Mansfield, MA
Posts: 8,760
Did you look at the interface patterns for the ocx?
Or are you now have sql problems?
striperman36 is offline   Reply With Quote
Old 10-02-2007, 01:47 PM   #5
striperman36
Old Guy
iTrader: (0)
 
striperman36's Avatar
 
Join Date: Oct 2004
Location: Mansfield, MA
Posts: 8,760
set a local variable in the page and then trigger the del btn click event
striperman36 is offline   Reply With Quote
Old 10-02-2007, 05:00 PM   #6
MrHunters
What was that!?!
iTrader: (0)
 
MrHunters's Avatar
 
Join Date: May 2005
Location: East Kingston, NH
Posts: 3,108
i cant tell if striperman is kidding or not... it sounds technical but it also sounds like a joke

what are you using for sql?
MrHunters is offline   Reply With Quote
Old 10-02-2007, 07:07 PM   #7
BrianS
Canal Junkie
iTrader: (4)
 
BrianS's Avatar
 
Join Date: May 2003
Location: Raynham
Posts: 1,678
Send a message via AIM to BrianS
SQL Server 2000

Sql problem resolved.... now i need to figure out how to disable a postback.... filling out a form with a query, want to edit it, and save it, but clicking the button forces a postback so i lose all my changes...

boo...

got some ideas ill have to try tomorrow

aim: SaltedBrian
BrianS is offline   Reply With Quote
Old 10-05-2007, 03:13 PM   #8
striperman36
Old Guy
iTrader: (0)
 
striperman36's Avatar
 
Join Date: Oct 2004
Location: Mansfield, MA
Posts: 8,760
set the postback, refresh property to no.
striperman36 is offline   Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:30 AM.


Powered by vBulletin. Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Please use all necessary and proper safety precautions. STAY SAFE Striper Talk Forums
Copyright 1998-20012 Striped-Bass.com