|
|
Hey... you placed the reply in wrong post.
You should reply the original person so that it could reach him.
|
|
|
|
|
1) Why are you reponding to me?
2) Why are you giving information that has already been given?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Hello friends,
I am writting a mini-forum web-based application using c#. I need to display the data on a data control. I want to display the data on a data control otherthan the GridView control just like the one I see on this site forum. Which of the (Repeater or ListView) controls is suitable for this purpose and how?
Also, how do I always fetch the latest post and pagging mechnism to the oldest post?
Thanks for your usual assistance and supports.
Tunsten
|
|
|
|
|
I think you can use either of them. Repeater has better grip on html than Listview. You can use it if you want to write your own html totally.
tunsten wrote: how do I always fetch the latest post and pagging mechnism to the oldest post?
For this, you can just sort the query based on post date.
|
|
|
|
|
Hi..
currently i m using asp.net 2.0 with sql server 2000.
actually i m planning to execute the code, which i got from the following link...
http://www.c-sharpcorner.com/Blogs/BlogDetail.aspx?BlogId=283[^]
i need to above coding in C#.NET, so i converted it using the following link...
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
while i m trying to run the above code i got the following error...
No overload for method 'Open' takes '1' arguments (xlBooks.Open((Server.MapPath(Request.ApplicationPath) + "\\XLTemplate.xls"));)
As it clearly mentioned that i m supplying the in-sufficient arguments. but i dont know how to resolve it. nearly 13 arguments are there... how to solve it... ?
And also
xlBook = xlBooks.Item[1]; here there is no Item available...
help me plz.
-Karan
|
|
|
|
|
|
Hello Sir,
I have created dynamic table which contains textboxes which counts equal to the value in the text box (for entering number of rows to show) on the page & hence appears it.
Now, I want that when user click to any of the textbox, I want to have its ID so that I will work on it further OR how to know which textbox have been focused.
I m not getting any idea as it is dynamic control.
Please help me!
Thanx.
|
|
|
|
|
When u dynamically add control.at the same time u also add id for each of the textbox in for loop..and then access the id(i.e TextBox) which u want.....
Sharing Of Knowledge Provides Solution....
|
|
|
|
|
Rohit,
I have did it otherwise, text boxes wud not appeared on the page.
|
|
|
|
|
I suspect your question is not clear. If you want to access the controls on the client side, you need to pass the ClientID property through to javascript on the client side. This would be the same no matter how they were created.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
The big issue with dynamic controls is that if you don't create them before page load, they have no viewstate.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Ok Sir,
but I just want to track which txt box has been focused , or hovering or clicking it a msg to show or will go to the redirected page. It will also work.
Your excellency.
|
|
|
|
|
Hai
i want to send sms from website any one explaine about that , ya i download some model projects but all the project send sms by using web services , i am working with asp.net C#, so help me out friend's
|
|
|
|
|
fak.kumar wrote: but all the project send sms by using web services ,
Well, of course they would. How else would a web page send an SMS ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
fak.kumar wrote: i download some model projects but all the project send sms by using web services , i am working with asp.net C#, so help me out friend's
So what is your problem?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Of course, there should be some web interface which sends sms for you. If you are looking for a free service, you might go for way2sms. but I dont think it is a good idea as it works only for India.
There are lots of other sites which offer sms services with minimum cost. You might opt for them.
|
|
|
|
|
fak.kumar wrote: ya i download some model projects but all the project
If you Dont Want to use webservice build your own server..!
Otherwise there is no other option Maximum third party guys provides Webservices to send sms
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
hii m getting error:Object cannot be cast from DBNull to other types
when m trying to update the productqty.the code is:
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = (DataTable)Session["cart"];
DataList1.DataSource = dt;
DataList1.DataBind();
}
}
protected void Datalist1_Update(object source, DataListCommandEventArgs e)
{
int ProductID = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
TextBox txtProductQty;
txtProductQty = (TextBox)e.Item.FindControl("txtProductQty");
string connectionstring = ConfigurationManager.ConnectionStrings["SilverOnline"].ConnectionString;
SqlConnection conn = new SqlConnection(connectionstring);
string str="Update Home Set ProductQty=@ProductQty Where(ProductID=@Productid)";
SqlCommand cmd = new SqlCommand(str,conn);
cmd.Parameters.Add("@ProductQty", SqlDbType.VarChar).Value = txtProductQty.Text; ;
cmd.Parameters.Add("@Productid", SqlDbType.Int).Value = ProductID;
if (conn.State == ConnectionState.Closed)
conn.Open();
cmd.ExecuteNonQuery();
if (conn.State == ConnectionState.Open)
conn.Close();
DataList1.EditItemIndex = -1;
DataTable dt = (DataTable)Session["cart"];
DataList1.DataSource = dt;
DataList1.DataBind();
}
plz guide....
|
|
|
|
|
"m workin as a web developer in a software company.
i work on asp.net using csharp....."
And you've been a member here for some time, but you still think that your use of horrible and worthless variable names is a good subject line and can't read an error message ?
mylogics wrote: if (!IsPostBack) { DataTable dt = (DataTable)Session["cart"]; DataList1.DataSource = dt; DataList1.DataBind(); }
Things that suck about this code
1 - you have a datatable in the session
2 - your page will blow up if no table is found
3 - the prerender event is when you should bind to data sources. For example, you're rebinding PRIOR to the update event, which is probably going to screw you up.
You're REALLY paid to write web code ?
mylogics wrote: string str="Update Home Set ProductQty=@ProductQty Where(ProductID=@Productid)"; SqlCommand cmd = new SqlCommand(str,conn); cmd.Parameters.Add("@ProductQty", SqlDbType.VarChar).Value = txtProductQty.Text; ; cmd.Parameters.Add("@Productid", SqlDbType.Int).Value = ProductID;
This is so, so hideous. I can only assume your clients are never people who have any idea about application development ?
mylogics wrote: DataTable dt = (DataTable)Session["cart"]; DataList1.DataSource = dt; DataList1.DataBind();
Where in this mess, do you expect the value in your sesson to be updated by the SQL you ran ?
This is an utter disaster. I don't see much worth salvaging, you work in a company ? Are there more experienced developers who could help you start this task again, or are you the zenith of the skillset there ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
A couple of things to add
1 - if you want help, respond when we try to answer you
2 - try reading the posting guidelines, you obviously never have
3 - if you can't tell us what line is causing the error, or detailing what debugging you've done, when you admit that you're being paid for this utter disaster, then don't expect too much help. We couldn't recreate your situation if we wanted to, so we can't run your code, you need to tell us what line blows up, at least.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
protected void Update(object source, DataListCommandEventArgs e)
{
int ProductID = Convert.ToInt32(DataList1.DataKeys[e.Item.ItemIndex]);
TextBox txtqty;
txtqty = ((TextBox)e.Item.FindControl("txtqty"));
string connectionstring = ConfigurationManager.ConnectionStrings["SilverOnline"].ConnectionString;
SqlConnection conn = new SqlConnection(connectionstring);
SqlCommand cmd = new SqlCommand("Update Home Set ProductQty=@productqty Where ProductID=@productid", conn);
cmd.Parameters.Add("@productqty", SqlDbType.VarChar).Value = txtqty.Text;
cmd.Parameters.Add("@productid", SqlDbType.Int).Value = ProductID;
if (conn.State == ConnectionState.Closed)
conn.Open();
cmd.ExecuteNonQuery();
if (conn.State == ConnectionState.Open)
conn.Close();
DataList1.EditItemIndex = -1;
// Bindlist();
Session["cart"] = dt;
DataList1.DataSource = dt;
DataList1.DataBind();
lbltotal.Text = "Rs." + gettotal();
}
You posted this a week ago. All the changes I Can see in your code from then, represent places where it might have worked before, and it won't now. It looks to me like you've wandered aimless for an entire week before asking again.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
mylogics wrote: plz guide....
Stop writing software. It's plain you have a job you don't deserve, you have no clue what you're doing, you ask the same questions over and over and when people try to answer, you don't respond.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi everybody,
My request out here is Urgent, though i have passed through what I could access in this forum and others also, but cannot finding a working solution.
I have designed an ASP.NET application, at our organizational intranet, I have used Windows Authentication and it worked very efficiently. My problem is, I want my application to ask for re-entering of employee's credential when he clicked on a log out control ( it could be anything - i didn't decided what will trigger log out yet ). I want it to be like Sharepoint page where you can log as another user in the same machine.
I m using following code but not working properly.
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
if (!this.IsPostBack)<br />
{<br />
_User = User.Identity.Name.Replace("Domain\\", "");<br />
Label1.Text = _User;<br />
}<br />
}<br />
protected void LinkButton1_Click(object sender, EventArgs e)<br />
{<br />
<br />
Response.StatusCode = 401;<br />
Response.StatusDescription = "Unauthorized";<br />
Response.End();<br />
Response.Redirect("Default.aspx"); <br />
}<br />
<br />
and HTML is
<br />
<head runat="server"><br />
<title>Untitled Page</title><br />
</head><br />
<body><br />
<form id="form1" runat="server"><br />
<div><br />
<p>Hello <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></p><br />
<asp:LinkButton ID="LinkButton1" runat="server" onclick="LinkButton1_Click">Sign in as Different user</asp:LinkButton><br />
</div><br />
</form><br />
</body><br />
</html><br />
I am waiting ...
Thanks.
|
|
|
|
|
I Have also tried
document.execCommand("ClearAuthenticationCache")
but it only works on IE and on the server machine only , on clients machine it won't work
|
|
|
|