|
Just right-click on the project (Web Application) from Solution Explorer, click on Add Web Reference. You will get a dialog box. Under a label: [Browse to:] click [Web services in this solution]. VS will discover all the web services in your solution and they will be presented in a list. Click on the one you want to use and, after giving it an appropriate web reference name add it (VS might suggest something like 'localhost'). You will then be ready to go. You can add the sample code on the Page_Load of a web form in your web application.
|
|
|
|
|
Thanks lol, I'll try and let you know what happen in my side.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Ok, As you said I add reference into the web application of the web service. I can build the solution fine, but I cannot run it. How can I run the web application? Please help me.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Wow, nice work lol. I've figured what the mistake I've done.
Seems to me using the IDE, just pressing F5, cannot run the web application. I have to type the URL and run the browser. It's working fine. Is that right lol.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I need to bind the SitemapDataSource to ListView.
And I need to show the sitemap as follows:
Home
node a| node aa| node aaa
| | node aab
| | node aac
------------------------------
| node ab| node aba
| | node abb
| | node abc
------------------------------
node b| node ba
| node bb
| node bc
The leaf nodes within the same parent node are contained in one table cell.
The annoying thing here is that:
Sometimes "node aa, node ab" is separate into two cells if they have child nodes.
But "node aa, node ab" will merge into one cell if they don't have child nodes.
Can anyone think of a good solution to show the data?
Should I use ListView in this case? Is there any easier way to do this?
Thanks.
|
|
|
|
|
i wanna use the hashtabl concept to fill the dropdownlist and use the hashtable in the selected item change event of the dropdownlist .. but wenever i refresh the page it shows the error
"Item has already been added. Key in dictionary: "10" Key being added: "10" "
and i chked the databse and i dont have the duplicate keys ... but i still get this error ..can anyonehelp wat cud be the reason and how to solve it and the code snippet is (in the page load event )
OleDbDataAdapter ada = new OleDbDataAdapter("Select * from HOSP",oledb);
DataTable Dhosp=new DataTable();
ada.Fill(Dhosp);
hHospital2.Clear();
foreach(DataRow row in Dhosp.Rows)
{
if (hHospital2.Contains(row["HOSPID"].ToString()))
{
Response.Write(row["HOSPID"].ToString());
}
else
{
hHospital2.Add(row["HOSPID"].ToString()+"~"+row["HOSPADD"],row["HOSPNAME"].ToString());
hLH.Add(row["HOSPNAME"],row["LOCATION"]);
}
}
HospId.DataSource = Dhosp;
HospId.DataMember="Hosp";
HospId.DataTextField="HOSPNAME";
HospId.DataValueField="HOSPID";
HospId.DataBind();
|
|
|
|
|
I suspect its telling the truth. Have you tried running in debug and actually seeing when it goes wrong - postback perhaps?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
yeah exactly ..during the postback it gives this error ....
|
|
|
|
|
Thats the problem then. Don't do the load during postback, it isn't needed.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
You are databinding the control on postback also. That means that you will re-add all the elements that the control already keeps in ViewState.
Either only databind on the initial load, or keep the control from using ViewState.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
This should help[^]
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Don't Repost
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
I want to write a complex system that does all sorts of complex stuff. I am a beginner. What's wrong with this picture ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Hi,
I am trying to a website similar to Google doc,the website should be able to handle,document files, spreadsheet,presentation,images.the files can be viewed,edited and deleted based on the permission .
The Important point is that all the manipulation,such as editing,viewing and deleting is done online,the files should not be downloaded to the client system.the client can view a document online and based on this permission, he can act.
step 1: the file will be uploaded to the website.
step 2: the user can view the file online.
step 3: If wanted he can share or edit the file.
step 4: If shared, the person to whom it is shared can log in and view the file.
all the above actions are done in the website,the file strictly cant be downloaded.(important Viewing is done in the website).
i am a beginner, i am not sure how to begin,so it would help me out if some one can point me in the right direction.Thanks in advance
Regards
Navin
|
|
|
|
|
Clickety
Sathesh.
Blessed is the season which engages the whole world in a conspiracy of love.
|
|
|
|
|
kindly tell me ,i have to fetch some records from the database and convert it to XML, using XSLT.
|
|
|
|
|
If you are using SQL Server (and probably Oracle supports it too) you can select directly into XML from the database. Google for AS XML should give you loads of examples.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I have menu control declared like the below:
<div>
<asp:Menu...
menu items here
</asp:Menu>
I have 40 menu items. All these are displaying in one line with the horizantal scrollbar is displaying fro the page. How to avoid the horizantal scroll bar? When the width exceeds 100%.
Thanks in advance
|
|
|
|
|
I would recommend you to first calculate the width of page then re-size your menu items accordingly.
OR
show them in multiple lines if you can not resize
Ahsan Ullah
Senior Software Engineer
|
|
|
|
|
I have a task of Embeding Image with text.it works fine in Ordinary Asp.Net Page but Ajax.
I have come accross the error"Parameter is not vaid" while converting Physical path of image into bitmap image.I am sending code(Aspx code and class file) with this mail kindly Let me know how to solve this error.
Code:
Aspx Page:
private void WaterImaging()
{
if (!string.IsNullOrEmpty(fuPictureImage.PostedFile.FileName))
{
if (!string.IsNullOrEmpty(txtEmbedText.Text) & !string.IsNullOrEmpty(txtLeft.Text) & !string.IsNullOrEmpty(txtTop.Text))
{
string imagePath = null;
string strFileNameToSave = null;
string fname = null;
imagePath = fuPictureImage.PostedFile.FileName;
fname = Path.GetFileName(imagePath);
strFileNameToSave = Server.MapPath(".") + @"\uploads\watermarkimages\" + fname;
DAMS_Cls_Imaging.EmbedText(imagePath, txtEmbedText.Text, ddlFontName.SelectedItem.Text, ddlFontColor.SelectedItem.Text, ddlSize.SelectedItem.Text, txtLeft.Text, txtTop.Text, strFileNameToSave);
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "Message", "alert('Enter all the Parameter Values for Embed a Text');", true);
}
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "Message", "alert('Select Image to perform the Operation');", true);
}
}
Class.cs(File)
public static Bitmap EmbedImage(string imagePath, string imgEmbedPath, string width, string height, string left, string top)
{
Graphics graphEmbedImage = default(Graphics);
//Dim BrushColor As System.Drawing.Brush
string strImagePath = null;
string strTempPath = null;
strTempPath = Path.GetFileName(imagePath);
strImagePath = Path.GetFullPath(imagePath);
Bitmap bmpImage = new Bitmap(strImagePath); \\This is where I am getting Error Parameter not valid"
try {
Image embededImage = default(Image);
embededImage = Image.FromFile(imgEmbedPath);
int iWidth = 0;
int iHeight = 0;
int iLeft = 0;
int iTop = 0;
iWidth = Convert.ToInt32(width);
iHeight = Convert.ToInt32(height);
iLeft = Convert.ToInt32(left);
iTop = Convert.ToInt32(top);
graphEmbedImage = Graphics.FromImage(bmpImage);
graphEmbedImage.DrawImage(embededImage, iLeft, iTop, iWidth, iHeight);
return bmpImage;
}
catch (Exception ex) {
throw ex;
}
finally {
graphEmbedImage.Dispose();
}
}
thanks
suresh
|
|
|
|
|
Would you like a list of all the ways this code could be improved ? There's quite a few. Why would you create strings, set them to null, then reassign them ? Why catch an exception to rethrow it ? What happens if the width/height are not valid numbers ? Why not take them as numbers in the first place ?
And, duh. You're passing the path on the client, and trying to load it, from what I can see. Do you know how to use the debugger ?
Christian Graus
Driven to the arms of OSX by Vista.
"Iam doing the browsing center project in vb.net using c# coding" - this is why I don't answer questions much anymore. Oh, and Microsoft doesn't want me to.
|
|
|
|
|
Hello All,
As one who hasn't done too much with ASP.NET, I was wondering, if any of you would like, if the following is a good logical step to a situation I have:
I have a web form that I will repost with a click of a button. But, want a different panel to show depending on the button pushed. Should I set some sort of variable in the code behind in the button_click event and then check that variable in the "if (ispostback)" flow? Or is there an easier more logical way of doing this.
Any comments are welcome.
|
|
|
|
|
Just change the visibility of your panels or multiview in the button_click event. Or call a function with the visibility logic if you prefer that.
|
|
|
|