|
Hello, I'm new to asp.net 2.0.. I know VB but not C#.. I want a user to be able to type their last name in a text box and have their info show in a datagrid, then when they select thier record I want their Customer ID to update the Service Quote table.. Basically the user is just finding their info and starting a new service quote( which is another SQL table).. How do you use a datagrid to update a SQL table in ASP.net 2.0?
Thanks!
|
|
|
|
|
If you allow the grid to support adding a row, you handle the event when the row is added, and then you write SQL to insert it into your DB.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I don't understand.. I'm sorry I'm new at all this.. I know how to update Sql using a datagrid but I want the selected customer ID to carry over to another page and then get inserted into a new datagrid that once completed will then get updated.. I guess i did not phrase my question correct..I understand the update table part just not how to reference the PK in the first datagrid and then carry the PK to another page and another datagrid...Does this make sense? Should I be doing this an entirely different way?
Thanks!
Cheryl
|
|
|
|
|
Oh, OK. Well, that's a new question....
The way to pass an id to a new page, is to put it on the querystring, so your link would be someting like mynewpage.aspx?id=27. They use Request.QueryString["id"] ( assuming this is C#, otherwise use () instead of [], b/c VB sucks ), to access the value ( it will be a string, use int.tryparse to get the number out ).
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Sorry, I still don't understand..Maybe I should just run a SQL insert query when a customer selects their name from the grid.. The problem is, I dont know how to reference the value in the grid... The value I want to reference is the key value( CustID)I want to insert this value into another table called servicequote..I thought the best way to do that would be to carry the CustID from the customer datagrid(based off the customer table) to another datagrid( based on the servicequote table) I guess that is not a good way??? So maybe I should just run an insert sql query when someone selects their name from the customer datagrid that inserts into the serice quotetable.. HOw do I do this? I need very very basic instructions like....in the HTML code type this and in the VB code type this...
Please help..
Thanks,
Cheryl
|
|
|
|
|
I can't find any resources about performing SQL injection or cross site vulnerability scans. I'm not sure if there are ASP.NET tools for this.
Is there a way to code a solution for this? I'm trying to provide a security solution.
Thanks
|
|
|
|
|
I'm not sure I follow. How does ASP.NET relate to the security of your DB code ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hercule54 wrote: I can't find any resources about performing SQL injection or cross site vulnerability scans. I'm not sure if there are ASP.NET tools for this.
Are you sure that you know what is SQL Injection and Cross site scripting? If yes, you can understand that there won't be any tools to find that. Here[^] is an article which takes SQL Injection in detail.
|
|
|
|
|
I've gone over the link you've posted. Since there are existing 3rd party & online applications that can scan sites, I thought there was a way either in ASP.NET or maybe another language to get the same results.
Thanks
|
|
|
|
|
I have a requirement to set maxlength for Textbox with multiline textmode. The property MaxLength is
not working when the textmode is multiline since it is rendered as textarea. There are couple of ways
explained in forums. I would prefer regular expression than Javascript.
A Regular expression that seems to be working does not work if the page uses master page. It
does not accept carriage return or newline or leading and trailing blanks and throws up error.
^[\s\S]{0,20}$
Have you come across such scenario before? If so, please help.
Thanks
|
|
|
|
|
I have a dev IIS server which displays the Printer dialog when I click the printer icon in a crystal report.
When I click the same icon on the production server, "failed to load page" message appears in a box the size of the printer dialog, no dialog.
I can't find help on this anywhere. Can anyone help?
Cheetah. Ferret. Gonads. What more can I say? - Pete O'Hanlon
|
|
|
|
|
Hi
I am deleting some DataTable records by using ajax and I am showing these DataTable records through Html table in .aspx page using InLine code.
suppose I have 3 rows and deleted 1 row then It should be shown 2 rows only in UI part but It is showing still 3 rows and when I refresh page by using F5 Key in keyboard then It's showing 2 rows that is I want.
but I dont want to show deleted row after deleting.
so how can I refresh page or load page controls again by writing code in .cs file.
because of using ajax It is not refreshing the page.
thanks
You get the best out of others when you give the best of yourself.
|
|
|
|
|
You need to delete the row using javascript, if you're writing your own AJAX. If you're using ASP.NET AJAX, you should be able to make the grid refresh using AJAX.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Yesterday, I started creating my web service, and essentially, I have a few projects:
-web service project
-application that calls web service web methods
-common class library
From the application, I added a web reference to the web service in the web service project. Today, when I try to update it by right clicking on the web reference, and then going to "Update Web Reference", I get the following error:
"There was an error downloading 'http://localhost:2276/NewWebService.asmx'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:2276
I'm not too sure why it was working fine yesterday but not now. Is there something that I need to restart, perhaps?
Thanks.
|
|
|
|
|
Is the web service running? Was there any firewall changes since yesterday?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Isn't Visual Studio supposed to do this for you?
Under the web tab for the web service project, I have it set to Use Visual Studio Development Server, and have it assigned to that specific port. I don't know if I have to actually "run" anything to run it though.
EDIT: So after hearing you mention that, I just tried to run the web service project itself... and it seems like you have to do that in order to get anything started.
In the meantime though, I have another question about web services and web methods (but I'll just reuse this existing thread).
I have a web method that takes in a class WebObject (something that I created).
public class WebObject
{
public WebObject(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
private WebObject()
{
}
public void SetX(int x)
{
this.x = x;
}
int x;
int y;
int z;
}
The web method, looks like this:
[WebMethod]
public WebObject AnalyzeObject(WebObject obj)
{
return obj;
}
What's happening though, is that behind the scenes, in some Reference.cs file generated by this web service, the WebObject is being transformed into this:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class ODPOObject {}
This new empty class makes it so that I cannot call the web method with my int x, int y, int z constructor, and if I attempt to create THAT WebObject, it complains that I'm passing in the wrong type. I don't understand this concept at all... would anyone be able to please clarify?
|
|
|
|
|
Cyrilix wrote: Isn't Visual Studio supposed to do this for you?
When you run the web service from VS, yes. But without VS, you need to have it in IIS. At least I think so ( I use the casini web server and it works fine there )...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
Since you already replied, and I was a little late in editing, I'll add the other part of my last post to this reply:
I have a web method that takes in a class WebObject (something that I created).
public class WebObject
{
public WebObject(int x, int y, int z)
{
this.x = x;
this.y = y;
this.z = z;
}
private WebObject()
{
}
public void SetX(int x)
{
this.x = x;
}
int x;
int y;
int z;
}
The web method, looks like this:
[WebMethod]
public WebObject AnalyzeObject(WebObject obj)
{
return obj;
}
What's happening though, is that behind the scenes, in some Reference.cs file generated by this web service, the WebObject is being transformed into this:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.1433")]
[System.SerializableAttribute()]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.org/")]
public partial class ODPOObject {}
This new empty class makes it so that I cannot call the web method with a web object created using my int x, int y, int z constructor, and if I attempt to create THAT WebObject, it complains that I'm passing in the wrong type. I don't understand this concept at all... would anyone be able to please clarify?
|
|
|
|
|
Strange! Code shows your WebObject class is not marked as serializable. To pass the object to webservice, it should be marked as [Serializable]
|
|
|
|
|
Hi All,
I am very new to ASP and need to create a simple dynamic image gallery wherein when the user clicks on the menus (collapsible kind) and the respective image shows up with the title and text. I could do this in simple HTML but then would have to create 20-30 pages.
Is there any way we can do this dynamically through ASP so on the same page all the variables are passed and the image/text changes accordingly. Hopefully this won't require any server side scripting?
I have uploaded a zip file here having the sample pages: http://www.filedropper.com/gallery_1
Thanks,
|
|
|
|
|
Yes you can do it using asp but i highly doubt that anyone on this site will give you the source code for it. unless you pay them.
|
|
|
|
|
Do you mean ASP or ASP.NET ?
sannysmith wrote: . Hopefully this won't require any server side scripting?
Well, if it doesn't, then it would end up being pure HTML. What do you think ASP.NET code is ?
It sounds to me like you're not clear at all on what ASP.NET is. You should buy a book and work through it. Yes, your best bet is to use a control like a gridview or repeater and writing code that pages and displays your images.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hello dear.
I want to do following.
There is one dropdownlist on asp.net page.
On selection changed event a new dropdownlist should be created.
And on the each drop down list selection change event a new dropdownlist shold be added.
In Windows Form application i achieved this with the following code.
public partial class Form1 : Form
{
ComboBox c = null;
int y = 10;
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
c = new ComboBox();
c.Items.Add("Item 1");
c.Items.Add("Item 2");
c.Items.Add("Item 3");
c.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
c.Location = new Point(((ComboBox)sender).Location.X, y = y + 50);
Controls.Add(c);
}
}
It's urgent please help.
|
|
|
|
|
Yes, you can do it. But, you need to add the controls before page_load in order for their viewstate to be restored, and thus for events to fire. The other option is to have one or more hidden text controls and to use javascript to store the details of your state there, so that you can always read that and recreate your controls.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The problem is that we don't know how many drop down lists will be created. So how we can dynamically add the drop down list on asp.net page as the selected index change event of another drop down list control occurs.
If a demo is available then it will be a great favour.
Thanks for your time.
|
|
|
|