|
Add a new column to the gridview. The type of column to add is Command Field. So if you are in the design view of the aspx file, click on the gridview. Then go to the properties window and file the columns property. click on the button which will bring up the fields dialog. Select the command Field and click the add button.
As far as dealing with the actual code, there are two ways to do it. If you are using an objectdatasource or a sqldatasource, then in that control you point to the correct method to do the update insert delete. If you aren't using one of those controls you need to implement the gridview command method. Then check the e.Command to see if it is "Insert", "update" etc.
Hope that helps.
Ben
|
|
|
|
|
Hi ,
I'm using a web service to copy file to a network folder restricted to a specififc username & pwd.
I tried
<identity impersonate="treu" username="domain\user" password="pwd">
It did not work.
Thanks in advance
Priya
|
|
|
|
|
What do you mean by
Dpriya wrote: It did not work. ?
What error did you encounter?
|
|
|
|
|
Dpriya wrote: It did not work.
You need to be a bit more descriptive of what isn't working.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Dear Group,
we recently installed the sourceforge forum system on our server (MS SQL 2005) and were excited how well it worked.
However, after the most recent MS update, and using the compiler Visual Webdeveloper Express, we are suddenly receiving the error message:
"An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
Can you help us?
Many thanks,
Robert "Bobby"
|
|
|
|
|
|
Hello,
I'm trying to run the simple movie player demo from silverlight presented in MSDN Mag[^] july edition.
So, I downloaded the Silverlight SDK (which is a .js file) and installed the beta version of the plugin. However, I can't get the demo to work right, and I have no ideia as to why. Is it necessary to run the website with .NET Framework 3.0? Or am I doing something wrong?
|
|
|
|
|
HI guys
I want to create a dynamic drop down menu using asp which will have a default value.
I am very much new to asp so i am not able to find out how to do it.
Well i want when a user clicks on a link, the page will populate all the values in the drop down list which i have to get from a databse and makes a value(which i know) as default.
Can any one please help me out how should i proceed.
Thanks
Dash
|
|
|
|
|
there should be a bunch of examples online that will give you most if not all of the code you need. assuming that the value you want as the default is in the database, you just need to do dropDownList.SelectedValue = value; or you could use the SelectedIndex if you know exactly where the value will be in the data set and its location wont move. to bind the dropdownlist you just need to open an SqlConnection to the database set up a SqlCommand with your query and connection and use its ExecuteReader method to load a SqlDataReader which will then bind to a dropdown list like
sring sql = "";
SqlConnection myConnection = new SqlConnection(connectionString);
SqlCommad myCommand = null;
SqlDataReader myReader = null;
try{
myConnection.Open();
sql = "put your query here";
myCommand = new SqlCommand(sql, myConnection);
myReader = myCommand.ExectueReader();
dropDownList.DataSource = myReader;
dropDownList.DataTextField = "the field you want displayed";
dropDownList.DataValueField = "the value you want stored, like an id number"
dropDownList.DataBind();
//if you want to insert a value tat isnt in the database youjust need
dropDownList.Items.Insert(0,value);//i havnt used that ina while
//but is the locaiton in the array you want the item palces and value is the
//text to display
}catch(Exception e)
{
}
finally{
if(myCommand != null)myCommand.Dispose();
if(myReader !=null) myReader.Close();
myConnection.Close();
}
hope this helped
|
|
|
|
|
I'm trying to use a repeater to display news articles with a link to each article or pdf or whatnot, however i dont really want the user to know that they've left one site to open one of the pdfs and i didnt really want to copy everything around since the news stories can be shown on multiple sites. so i have a javascript function that opens a new window to a htm page that has a frameset, then i try to se the location of the frameset in the same javascript like:
function newWindow(url)
{
var win;
win = window.open("news.htm","NewsArticle",
"toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1");
win.frmNews.location = url;
}
this works great on my machine, but it wont work when i put it on our web server, it says that frmNews in null or not an object.
that is the code from the news.htm file minus the title, meta tags, etc... the window opens but i cant change the link. any help would be greatly appreciated.
|
|
|
|
|
make sure that you don't have the javascript running on the server side
runat="client"
|
|
|
|
|
That's because the frameset hasn't yet loaded in the window.
Send the url as a parameter in the querystring to the frameset page, make the page asn aspx page, and user server code in it to get the url from the querystring and put it into the frame code.
---
single minded; short sighted; long gone;
|
|
|
|
|
Thanks, i got it working now, there was also a problem with the slashes in the url some were \\ instead of // and apparently js is rather perticular about it. i just used a loop to make the js wait until the frame was loaded then set its url, not necessarily good practice, but it works, and it completely hides the url i'm going to like it should.
|
|
|
|
|
SomeGuyThatIsMe wrote: there was also a problem with the slashes in the url some were \\ instead of // and apparently js is rather perticular about it.
It's rather the web server that is particular. If you use backslashes, it will not be treated as a separator between folders, but as a part of the filename.
So the url "http://www.site.com/folder\another\page.html" will try to get the file "folder\another\page.html" in the root folder of the web, not the "page.html" in some subfolder.
---
single minded; short sighted; long gone;
|
|
|
|
|
that makes sense, thanks for the clarification.
|
|
|
|
|
Hi,
I have created one web application by using html page. I have created run time images and they are creating at run time in IE6 but not in IE7.
function for creating image is
return "";
what is the solution for that ?
Thanks
|
|
|
|
|
You have shown too little of your code to give any possibility to see any problem with it.
That code doesn't create any image. It just creates a string and returns it. That code has to go into a function to work, and you have to call the function and do something with the result in order for something to happen.
---
single minded; short sighted; long gone;
|
|
|
|
|
Morning Guys!
I have an issue. How would I go about exporting Data from a GridView to an Excel file or XML file? I would like it If I could export directly to excel.
Thanks!
Fritz Blignaut
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
|
I have a apache server in which i have protected a file with user name and password as shown:
<directory "c:="" program="" files="" apache="" group="" apache2="" cgi-bin"="">
# AllowOverride AuthConfig
AuthType Basic
AuthName "restricted stuff"
AuthUserFile password
Require user test
from the client i am using POST command to access the server with authorization details as
Authorization: BASIC "base 64 encoded string of username and password"
even then i am getting 401 error.
kindly help
|
|
|
|
|
Araj01 wrote: AuthUserFile password
Try a fully qualified path to the password file. Something like;
AuthUserFile /XXXXXXX/XXXXXXX/htpasswd
|
|
|
|
|
I am using windows machine so will it be
AuthUserFile "c:/program files/apache group/apache2/bin/passwords"
if i give without quotes it gives me error
|
|
|
|
|
Araj01 wrote:
if i give without quotes it gives me error
By all means specify it in quotes.
I am learning here, I didn't know that you could run an Apache server on a windows machine.
I would love to do that. Please tell me how I can proceed.
PS - did specifying the full path help?
|
|
|
|
|
JimmyRopes wrote: I am learning here, I didn't know that you could run an Apache server on a windows machine.
I would love to do that. Please tell me how I can proceed.
WAMP[^]
|
|
|
|
|
Johnny ² wrote: WAMP[^]
Thanks, this will do it.
|
|
|
|