15,917,610 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by giatuan2011 (Top 50 by date)
giatuan2011
30-Jul-12 1:32am
View
How to get content of line?
for example:string keep=line[0]
string keep=line[2]
giatuan2011
28-Jul-12 1:09am
View
How to reduce Count when I hit back or delete dots?
giatuan2011
22-Jun-12 8:41am
View
I mean you enter St and combobox appears.It will find the item named String.Press tab and richtext replace St with String
giatuan2011
22-Jun-12 8:38am
View
The solution is useful.
It uses the system.dll.
I just added project> ClassLibrary in C# 2008 to make dll.But I will have trouble when I want to add function into .Dll file.I have to recompile dll.
giatuan2011
18-Jun-12 14:05pm
View
Sorry,I use DropdownList in GridView.My RowDataBound:
protected void grdContact_RowDataBound(object sender, GridViewRowEventArgs e)
{
ContactTypeTableAdapter contactType = new ContactTypeTableAdapter();
DataTable contactTypes = GetData();
if (e.Row.RowType == DataControlRowType.DataRow)
{
DropDownList cmbType = (DropDownList)e.Row.FindControl("cmbType");
if (cmbType != null)
{
cmbType.DataSource = contactTypes;
cmbType.DataTextField = "ProductName";
cmbType.DataValueField = "ProductId";
cmbType.DataBind();
cmbType.SelectedValue = grdContact.DataKeys[e.Row.RowIndex].Values[0].ToString();
}
//DataKeysName is ProductName.
}
I can get selectedValue when using:
grdContact.DataKeys[e.Row.RowIndex].Values[0].ToString().Insert(5," ");
if Productid is 'PS00000001',It can't get PS001
giatuan2011
18-Jun-12 6:55am
View
Your solution is very effective.I'm trying to trap errors number format when the User enter wrong
giatuan2011
15-Jun-12 0:14am
View
So,the problem is Application variable?
I think I'll use Session when worker login then store in Application and lock it.All users can know workers status.But they can't logout worker.When the customer/worker logout,I'll check Session.If Session["worker"] exists,Application'll be removed.If not,he is the customer.He can't remove Application
giatuan2011
11-Jun-12 6:52am
View
Thank you.I think I should get value from GridView and re-update Datatable
giatuan2011
10-Jun-12 8:02am
View
I think I need prevent page refresh
giatuan2011
10-Jun-12 7:15am
View
DataList have 5 columns.the page was bouncing up when I select item in the second row.It's like being refreshed.I think so
giatuan2011
7-Jun-12 9:04am
View
So,It is Application[""]=value??
giatuan2011
7-Jun-12 9:02am
View
Deleted
<appsettings>
<add key="Workerid">
It is what you say.You want to me use web.config?
giatuan2011
7-Jun-12 6:43am
View
I just need to received an employee name.
You mean creating a normal variable in the page?
Ex:string WorkerName="<the employee's name after he login>";
giatuan2011
5-Jun-12 5:38am
View
Your solution is work.
But I have new problem.I need to create the id after assigning tbCart to Session ["Cart"].This only happens 1 time.I tried Random.It give me more id.How to make auto id?
giatuan2011
5-Jun-12 5:36am
View
I just added:
tbCart.Rows[rIndex][2]=int.Parse(tbCart.Rows[rIndex][2].ToString())+slxuat;
But I have new problem.I need to create the "id" after assigning tbCart to Session ["Cart"].This only happens 1 time.I tried Random.It give me more id.How to make auto id?
giatuan2011
5-Jun-12 5:17am
View
They are primakey key.
I think the OrderDetail has more products
giatuan2011
4-Jun-12 5:55am
View
I tried:
void MakeTable()
{
cart.Columns.Add("idProduct",typeof(string));
cart.AcceptChanges();
Session["cart"] = cart;
}
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e)
{
if (e.CommandName == "Add")
{
string product = e.CommandArgument.ToString();
cart = (DataTable)Session["cart"];
int count = cart.Rows.Count;
DataRow row = cart.NewRow();
row[0] = product;
cart.Rows.InsertAt(row, count);
cart.AcceptChanges();
Session["cart"] = cart;
}
}
And Bind as you.But GridView is empty
giatuan2011
20-May-12 8:21am
View
Can I set image background of <asp:button and Dropdownlist by jquery?
giatuan2011
20-May-12 7:23am
View
What version I should get?I do not think jQueryUI 1.7 can use for 2008
giatuan2011
18-May-12 3:30am
View
I have the page use Master.I tried:
<script src="btnImage.js" type="text/javascript"></script>
I put images in folder named Image:
document.Button1.src ="~/Image/BTN.png"
It doesn't work.
giatuan2011
18-May-12 2:45am
View
Thank you.I can use the theme?I think it will support all as tooltip,.....Where can I find a theme?
giatuan2011
18-May-12 0:16am
View
I think I should use the Session.After logging in, the Session will save the username.I just need get the Session by refresh page.
I should put it to Pagel_load content page and mater
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
if (Session["username"] != null)
{
txtuser.Text = Session["userna"].ToString();
}else{
Session["username"] = "<get from="" database="">";
txtuser.Text = Session["username"].ToString();
}
giatuan2011
17-May-12 9:48am
View
I mean username and password in Login.aspx, click login.And txtUser appear: Hi, <username>
I tried:
string sname;
protected void Button1_Click(object sender, EventArgs e)
{
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
ContentPlaceHolder con = (ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1");
TextBox tx = (TextBox)con.FindControl("txtusername");
txtuser = (TextBox)Page.Master.FindControl("txtUser");
sname = tx.Text;
txtuser.Text = sname;
}
It works.it is correct?
giatuan2011
17-May-12 9:32am
View
I thought after load Dang.aspx,txtMaster will take the contents of txtContent.
But when I press the button btnGet, the content of txtMaster does not change.
giatuan2011
17-May-12 9:05am
View
yes.I can set txtUser in Master load.But
ContentPlaceHolder con=(ContentPlaceHolder)Page.Master.FindControl("Content1");
TextBox txt = (TextBox)con.FindControl("txt"); txt.Text = txtuser.Text;
It does not display content of txtUser.
"contents pages loading event occuring before master pages loading event."
Oh,I understand why the txt does not show.I add button called btnGet in Dang.aspx and txt displayed content of txtUser.I can set content of txtUser after click btnGet.
Thank you.
giatuan2011
17-May-12 8:52am
View
Oh,I clear txUser.Text in Master load and go to properties,change text of txtUser to Hi.
TextBox txtuser = (TextBox)con.FindControl("txtUser");
It works.I think problem is Master load:txtUser.Text="Hi".
So, How do I get and set txtUser after logging in without problem?
giatuan2011
17-May-12 8:33am
View
you mean:in Dang.aspx,TextBox txtuser = (TextBox)con.FindControl("txtUser"); correct here?
txtUser is the control in Master.
txt is the control in ContentPlaceHolder.
When I remove txt,I can:
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
txtuser.Text="Hi,Guest";
After I add txt and change Master load:
protected void Page_Load(object sender, EventArgs e)
{
txtUser.Text = "Hi";
}
Dang.aspx:
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
txtuser.Text="change";
ContentPlaceHolder con=(ContentPlaceHolder)Page.Master.FindControl("Content1");
TextBox txt = (TextBox)con.FindControl("txt");
txt.Text = txtuser.Text;
txt is empty.txtUser is Hi.I can't change content of txtUser.
giatuan2011
17-May-12 8:02am
View
TextBox t = (TextBox)con.FindControl("txt");
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
I tried:
t.Text = "Hello";
t.Text = txtuser.Text.ToString();
It appears "Hello" in textbox of the page Dang.aspx.
txtUser not change.
I not found Content1.It only has ContentPlaceHolder,Content,Page and Master.
How can I attach files?
giatuan2011
17-May-12 6:22am
View
My ContentPlaceHolder Id is Content1 in Master.Asp.net 2005 and asp.net 2008 are different?What is Content2?
make Dang.aspx-> select master-> in design, I can not add anything to the ContentPlaceHolder.
I click CustomContent .. and Content 2 appears.
This is a problem?
giatuan2011
17-May-12 4:01am
View
I tried your code and:
ContentPlaceHolder con = (ContentPlaceHolder)Page.Master.FindControl("Content1");
TextBox t = (TextBox)con.FindControl("txt");
TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser");
t.Text is empty
giatuan2011
17-May-12 2:10am
View
TextBox txtuser=(TextBox)Page.Master.FindControl("txtUsername");
txtuser.Text="John";
I can set it.When I add textbox into ContentPlaceHolder,I can not set value of txtUsername to textbox
giatuan2011
16-May-12 9:18am
View
Sorry,Vasim889.I get good result from your code.Thank you so much
var q = dcon.sp_Login("John","123");
if (q.Count() ==1)
I have not changed, "John" and "123" to txtuser, txtpass.
giatuan2011
16-May-12 9:02am
View
I found:
var c = (from user in context.tblUser where user.username = txtusername.Text and user.password = txtpassword.Text).Count();
if c==1->success.
How to I change it?
giatuan2011
16-May-12 8:32am
View
select Count(*) is successful in sql server.
DataContextDataContext dcon=new DataContextDataContext();
string msg = "";
var q = dcon.sp_Login("John","1234");
if (q.Count()>0)
{
msg="success";
}
return msg;
not chage.Results as before
giatuan2011
16-May-12 8:12am
View
It is successful when passw="1234".I do not think Count (*) returns the number of row.Proc does not return
giatuan2011
16-May-12 7:39am
View
It doesn't work.Maybe I should use try catch
giatuan2011
16-May-12 6:55am
View
You're right.Use the try {}catch{} for failure results and success
Thank you.
giatuan2011
14-Jan-12 4:23am
View
I have an idea.
If I put an object as lines, rectangles into a PictureBox, I think it would be simpler.Then I just use Cotrols.Add to add PictureBox and move the PictureBox contains objects when user want to move line/Curve.
But I get a problem.That is the size of the PictureBox will change when clicking drawing.how to the transparent PictureBox background to the object behind don't lost?
giatuan2011
12-Jan-12 6:56am
View
So,I should use the PictureBox and MDI?
If that's true,I just need events:Paint,MouseMove,MouseDown for controls.
Finally,I want to move the drawing object and export lines,circles,...into the vector file formats.
How to do it?
giatuan2011
29-Dec-11 3:24am
View
great answer.
I just know say thanks very much.
I changed the class SockPack:
byte [] data = new byte [3] to byte [] data = new byte [1024];
and "UTF8" to Unicode.
I'm just a silly problem is how to scroll textbox to the last line
giatuan2011
20-Nov-11 8:53am
View
It's nice.thanksSo,how to antionscript2 into swf?
giatuan2011
14-Nov-11 23:25pm
View
Have You only one for both?
giatuan2011
14-Nov-11 23:24pm
View
Only one program is used for server and client are what you say?
I learned the two are separate
giatuan2011
14-Nov-11 23:21pm
View
Thank you.
Your solution is what I have learned.
I need a program for the server and client with form
giatuan2011
8-Nov-11 1:19am
View
Deleted
sorry, you are wrong?
I'm talking about programs that make use richtext swf, PictureBox
giatuan2011
5-Nov-11 2:37am
View
I do not know how to use .Add() and set properties.Can you give me more details?thank
giatuan2011
14-Aug-11 6:07am
View
Thanks,your answer. I have access to Microsoft.DirectX and Microsoft.DirectX.Direct3D.C# has Matrix,not D3DXMATRIXA16,D3DXVECTOR3.I suspect my C# version too old.Google has some D3D code C++6.After converting C + +8. I got a lot of errors.I can not use other versions because my college uses 2005.
giatuan2011
18-Jul-11 4:43am
View
Deleted
because gluUnProject always equal to const.How do I get mouseZ in 3D? can be combined X, Y values create Z? in 2D, I think Z is X = Y and something. but I do not find.If no Z is not 3D.All ideas, help will be appreciated
giatuan2011
17-Jul-11 3:21am
View
Oh,User control.good idea.
I can more easily control OpenGL
Can I use the split container?
The problem is how can install the OpenGL control over it
giatuan2011
8-Jul-11 2:12am
View
thanks
Oh,blender3D
but https://svn.blender.org/svnroot/bf-blender/trunk/blender dead.
I will try google.com
Show More