Click here to Skip to main content
       

ASP.NET

 
Your Date Filter setting means you have run out of messages to view.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
QuestionHOW TO ANSWER A QUESTIONadminChris Maunder12 Jul '09 - 22:39 
Apologies for the shouting but this is important.
 
When answering a question please:
  1. Read the question carefully
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
  3. If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
  4. If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
 
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

QuestionHow to get an answer to your questionadminChris Maunder10 Nov '05 - 16:29 
For those new to message boards please try to follow a few simple rules when posting your question.
  1. Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
     
  2. Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
     
  3. Keep the subject line brief, but descriptive. eg "File Serialization problem"
     
  4. Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
     
  5. Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
     
  6. Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
     
  7. If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
     
  8. Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
     
  9. Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
     
  10. Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
     
  11. If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
     
  12. No advertising or soliciting.
     
  13. We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
cheers,
Chris Maunder
 
The Code Project Co-founder
Microsoft C++ MVP

Questionhow to get the ID of the selected item in listview itemtemplate in asp.net2008memberbsurendra1 hr 54mins ago 
i am trying to create a shopping cart, on productdetails page i displaying productid, ProductName, productImage, ProductPrice and Buy Now Button. i have also created a movable shopping cart by using javascript. Now my problem is i am not able to pick the selected items id and send it javascript function for shopping cart. please guide me how to pick the id of the selected item and send it to the javascript function.
 

Thanks in Advance
GeneralTelerik Vs DevexpressmemberMohamed_hussain4hrs 22mins ago 
Hi guys,I'm mohamed hussain working as dotnet developer.can anyone point out what are all the technical difference between telerik and devExpress control ????? Smile | :)
GeneralRe: Telerik Vs DevexpressmvpRichard MacCutchan3hrs 43mins ago 
You need to go and do some research into the subjects; it's unlikely that anyone is going to be able to answer such a question.
Use the best guess

GeneralRe: Telerik Vs DevexpressmemberMohamed_hussain3hrs 21mins ago 
i already tried a lot.but still it's complicated to find out :(
GeneralRe: Telerik Vs DevexpressmvpRichard MacCutchan48mins ago 
Well it's complicated for everybody; but that's what being a developer is all about.
Use the best guess

QuestionWeb Services / Web References in ASP.NET using C#memberWickedFooker5hrs 18mins ago 
I have no idea what I am wrong. Needless to say it is giving me a compiler error "Error 1 'clsWebServices' does not contain a definition for 'FindAddress' and no extension method 'FindAddress' accepting a first argument of type 'clsWebServices' could be found (are you missing a using directive or an assembly reference?)"
 
What do I need to do to make this Web Method / Web Reference work properly? This is for a local Access .mdb file that resides under app_Data.
 
This is what I have under App_Code for clsWebSerices.cs:
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.Data.OleDb;
using System.Web.Services;
 

/// <summary>
/// Summary description for clsWebServices
/// </summary>
 
public class clsWebServices : System.Web.Services.WebService {
 
    public clsWebServices () {
 
        //Uncomment the following line if using designed components 
        //InitializeComponent(); 
    }
    public class Service1 : System.Web.Services.WebService
    {
        [WebMethod]  
        public dsAddress FindAddress(string LastName, string Path)
        {
            
            
            string connectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" + Path;
            string commandText = "select * from tblAddressBook where LastName like '" + LastName + "'";
 
            dsAddress DS = default(dsAddress);
 
            using (var connection = new OleDbConnection(connectionString))
            using (var command = new OleDbCommand(commandText, connection))
            {
                // OleDbCommand uses positional, rather than named, parameters.
                // The parameter name doesn't matter; only the position.
                DS = new dsAddress();
                var adapter = new OleDbDataAdapter(command);
                adapter.Fill(DS);
            }
 
            // Add your comments here
            return DS;
 
        }
        
    }
    
    
}
 
 
And for clsWebServices.asmx:
<%@ WebService Language="C#" CodeBehind="~/App_Code/clsWebServices.cs" Class="clsWebServices" %>
 
frmAddressBook.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="frmAddressBook.aspx.cs" Inherits="frmAddressBook" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server" action="clsWebServices.asmx" method="post">
    <div>
    
        <asp:Label ID="Label1" runat="server" Text="Find Last Name: "></asp:Label>
        <asp:TextBox ID="txtFindLastName" runat="server"></asp:TextBox>
        <asp:Button ID="btnFindLastName" runat="server" Text="Search Now" 
            onclick="btnFindLastName_Click" />
        <br />
        <br />
        <br />
       
        <asp:Label 
             ID="lblMessage" runat="server" 
             Text="Search Result (first record to match)" Font-Size="XX-Large"></asp:Label>
         <br />
            <br />
            <asp:Label ID="Label2" runat="server" Text="First Name: "></asp:Label>
             
         <asp:TextBox ID="txtFirstName" runat="server" BackColor="#FFFFCC"></asp:TextBox>
         <br />
         <br />
         <asp:Label ID="Label3" runat="server" Text="Last Name: "></asp:Label>
     
         <asp:TextBox ID="txtLastName" runat="server" BackColor="#FFFFCC"></asp:TextBox>
         <br />
         <br />
         <asp:Label ID="Label4" runat="server" Text="Email: "></asp:Label>
            
         <asp:TextBox ID="txtEmail" runat="server" BackColor="#FFFFCC"></asp:TextBox>
         <br />
         <br />
         <asp:Label ID="Label5" runat="server" Text="Phone Number: "></asp:Label>
         <asp:TextBox ID="txtPhoneNumber" runat="server" BackColor="#FFFFCC"></asp:TextBox>
        </div>
    </form>
</body>
</html>
 
The code behind:
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class frmAddressBook : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void btnFindLastName_Click(object sender, EventArgs e)
    {
        lblMessage.Text = "";
        try
        {
            clsWebServices serviceObj = new clsWebServices();
            dsAddress dsFindLastName = new dsAddress();
            string TempPath = Server.MapPath("~/App_Data/AddressBook.mdb");
 
            dsFindLastName = serviceObj.FindAddress(txtFindLastName.Text, TempPath);
 
            if (dsFindLastName.tblAddressBook.Rows.Count > 0)
            {
                DataRow r = dsFindLastName.tblAddressBook.Rows[0];
                txtFirstName.Text = r["FirstName"].ToString();
                txtLastName.Text = r["LastName"].ToString();
                txtEmail.Text = r["Email"].ToString();
                txtPhoneNumber.Text = r["PhoneNumber"].ToString();
            }
            else lblMessage.Text = "No records found!";
        }
        catch (Exception ex)
        {
            lblMessage.Text = ex.Message;
        }
    }
}
 
I have tried to add a WEB REFERENCE in VS2008 and it says :
This web service is using http://tempuri.org/ as its default namespace.
Recommendation: Change the default namespace before the XML Web service is made public.
[WebService(Namespace="http://microsoft.com/webservices/")]
public class MyWebService {
    // implementation
}

AnswerRe: Web Services / Web References in ASP.NET using C#professionalRichard Deeming4hrs 27mins ago 
The error message is quite clear, and also correct. The class clsWebServices doesn't contain a method called FindAddress. That method is defined on a nested class called Service1.
 
Either move the method to the outer class, or change the class you're creating:
clsWebServices.Service1 serviceObj = new clsWebServices.Service1();



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


Questionplease help me create form comment in asp.net mvcmembersmile9x14hrs 21mins ago 
you can share for me source code form comment ?
I want to create form comment with avatar(of user) and it can edit, delete, and save to database.
thanks !!

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   


Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 23 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid