コード例 #1
0
        protected void btn_Message_Click(object sender, EventArgs e)
        {
            profileref.UserProfileServiceClient client = new profileref.UserProfileServiceClient("BasicHttpBinding_IUserProfileService");
            profileref.Message     message             = new profileref.Message();
            profileref.UserProfile user = new profileref.UserProfile();
            string des = msgdes.Text;
            string sub = msgsub.Text;

            if (des == "" || sub == "")
            {
                Label2.Text      = "Required";
                Label3.Text      = "Required";
                Label2.ForeColor = Color.Red;
                Label3.ForeColor = Color.Red;
            }
            else
            {
                message.Msgdes = msgdes.Text;
                message.Msgsub = msgsub.Text;
                user.UserID    = (int)Session["userid"];
                string result = client.SendRequest(user, message);
                Label3.Text      = result;
                Label3.ForeColor = Color.Green;
            }
        }
コード例 #2
0
        void BindGrid()
        {
            profileref.UserProfileServiceClient client = new profileref.UserProfileServiceClient("BasicHttpBinding_IUserProfileService");
            profileref.Message message = new profileref.Message();
            DataSet            ds      = new DataSet();

            ds = client.GetMessages();
            GridView1.DataSource = ds;
            GridView1.DataBind();
        }