|
ok sure.
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
rummer wrote: Please provide code for page ranking
Sure sir, it will be our pleasure to write code on your behalf.
rummer wrote: as soon as possible.
But as you must have read in terms & conditions while signing up for an account on code project that we do not work on week ends. Unfortunately, today is Saturday & we have some plan with our family.
Is it OK with you if we can start writing code from Monday?
Till then you can use google to find any helpful URL.
|
|
|
|
|
hi, iam using asp.net with c#
in my gridview control in template field iam having a checkbox control
when user selects the checkbox that row should be added to data base when user clicks on add button, but user is selecting the check box but without clicking on add button the user is clicking the next button to navigate on other page .how to handle this situation. can u give me example which helps me
|
|
|
|
|
|
I am so sorry. I just saw that answer was not posted. Actually I posted it through my mobile. So may be something went wrong. Posting it again.
You mean if a user checks the CheckBox, he should not be able to click on the button.
You can do this using JavaScript. The logic that you would use here is, if the user checks any CheckBox, you should disable the (next) button. So handle CheckBox's onClick event. And in that even write code to disable the button.
<asp:CheckBox ID="CheckBox1" runat="server" onclick="javascript:disableNavigation();" />
<script type="text/javascript">
function disableNavigation()
{
if(document.getElementById("CheckBox1").checked == true)
{
document.getElementById("Button1").disabled = true;
}
else
{
document.getElementById("Button1").disabled = false;
}
}
</script>
..Go Green..
modified on Saturday, June 5, 2010 2:58 PM
|
|
|
|
|
hi , iam using asp.net with c#
iam sending gridview data in a mail ,but when gridview having many records in pages then, only first page is send in email and other pages are not send , can you correct my code how to send all data in a mail
public override void VerifyRenderingInServerForm(Control control)
{
}
private string GridViewToHtml(GridView gv)
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(sw);
gv.RenderControl(hw);
return sb.ToString();
}
protected void Button3_Click(object sender, EventArgs e)
{
if (txtgrandtotal.Text == "")
{
clsdataset.ShowAlertMessage("please click addbutton");
}
else
{
SqlConnection con1 = new SqlConnection(ConfigurationManager.ConnectionStrings["InventoryConnectionString"].ConnectionString);
string note = TextBox2.Text;
Session["note"] = note.ToString();
CheckBox cc; Label id; Label categorynamee; Label itemkey; Label itemkeynamee; Label currentqty; Label salesprice;
Label quantity; Label total;
foreach (GridViewRow rr in GridView1.Rows)
{
cc = (CheckBox)rr.FindControl("chk");
id = (Label)rr.FindControl("Label2");
categorynamee = (Label)rr.FindControl("Label3");
itemkey = (Label)rr.FindControl("Label4");
itemkeynamee = (Label)rr.FindControl("Label5");
currentqty = (Label)rr.FindControl("Label6");
salesprice = (Label)rr.FindControl("Label7");
quantity = (Label)rr.FindControl("Label8");
total = (Label)rr.FindControl("Label1");
Session["Orderno"] = id.Text;
if (cc.Checked == true && cc.Visible == true)
{
SqlCommand cmdupd = new SqlCommand("addnotesproc", con1);
con1.Open();
cmdupd.CommandType = CommandType.StoredProcedure;
cmdupd.Parameters.AddWithValue("@OrderNo", Convert.ToInt32(id.Text));
cmdupd.Parameters.AddWithValue("@Note", TextBox2.Text);
cmdupd.ExecuteNonQuery();
con1.Close();
SqlCommand cmptbldetails = new SqlCommand("Addorderdetails", con1);
cmptbldetails.CommandType = CommandType.StoredProcedure;
con1.Open();
cmptbldetails.Parameters.AddWithValue("@OrderNo",Convert.ToInt32(id.Text));
cmptbldetails.Parameters.AddWithValue("@CategoryNameE",categorynamee.Text);
cmptbldetails.Parameters.AddWithValue("@ItemKey",itemkey.Text);
cmptbldetails.Parameters.AddWithValue("@ItemKeyNameE",itemkeynamee.Text);
cmptbldetails.Parameters.AddWithValue("@CurrentQTY",currentqty.Text);
cmptbldetails.Parameters.AddWithValue("@SalesPrice",salesprice.Text);
cmptbldetails.Parameters.AddWithValue("@Quantity",quantity.Text);
cmptbldetails.Parameters.AddWithValue("@Total",total.Text);
cmptbldetails.ExecuteNonQuery();
con1.Close();
}
}
System.Net.Mail.SmtpClient smtp = new SmtpClient();
System.Net.Mail.MailMessage msg = new MailMessage();
MailAddress fromaddress = new MailAddress("order@xyz.net");
msg.From = fromaddress;
string mailto = Session["Areamanager"].ToString();
msg.To.Add(mailto);
msg.Subject = "your Purchase Details";
msg.Body = "ShopId::" + Session["UserName"].ToString() + "<br><br>" + "ShopName::" + Session["sendershopname"].ToString() + "<br><br>" + "OrderNo::" + Session["Orderno"].ToString() + "<br><br>" + "OrderDate::" + DateTime.Now.ToString() + "<br><br>" + "Total::" + Session["total"].ToString() + "<br><br>" + Session["note"].ToString() + "." + "<br><br>" + GridViewToHtml(GridView1);
msg.IsBodyHtml = true;
smtp.Host = "localHost";
smtp.Port = 25;
smtp.UseDefaultCredentials = true;
smtp.Send(msg);
Response.Redirect("mailsend.aspx");
}
}
i want to send all data from gridview ,can you correct my code which helps me
|
|
|
|
|
hi,
When you use GridView with paging in asp.net it will only load one
page at a time.
So you cannot access all the pages at one time. To send all records in mail
you need to load all the records either in DataSet or in html format.
Once you have all the records in DataSet you can use it's tables to send all
records in mail
Like,
DataSet1.Tables[0]
So, you need to code accordingly.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
hi,
i think my story is simple, but i cant find a clue
i have a vb.net winform application that i developed and i will install it in a computer, i need to automatically Expire the lisence on a special date "ex: 01/01/2011" , i'm afraid that the user changes his local machine time and continue to work on the application.
by the way: the computer is not connected to the internet.
ps: i'm using sql server too, can that help??
thanks in advance
|
|
|
|
|
The better way is to set a counter, means when user installs the application from that time to the day it expires how many days, set this counter in a registry (don't forget to encrypt the value) now deduct 1 from the counter value every time user runs the application. if the counter reaches 0 application expires. now what if the user never closes the application ? start a timer when application starts and after 24 hrs deduct 1 from the timer again. still there are chances of hacking, but only if the user is 'pro' and he knows how the expiration works, in that case he will backup the registry and restore it every few days. so the best way is to invest in hardware lock, there are USB based hardware locks are available, you can include the cost of the hardware lock in your application price. trust me I have done all kind of crazy stuff to protect my software, and the best way is Hardware Lock. (I have even lock the application to a specific Hard Disk serial number to avoid multiple installation but that is to annoying for the end user).
|
|
|
|
|
yes i've done that serial thing before thats a cool one
ok what about if the user is running the program several times a day the counter will deduct more,
listen i thought of something, give me your idea about it,
i set a counter yes, and a save the installation date, and then by every application start, i get the date, and compare by the date i have, the my date is smaller i update it by his date, and reduce the counter, but if the my date is bigger i just lock the application, so i think by this way i am double checking one by counter, two by the date,
please give me your idea
|
|
|
|
|
Yes, this is good idea, or you can store a date with the counter. if the stored date and current date is same then do not deduct the counter, other wise deduct the counter and update the stored date with current date. in this case the application will run for the expected number of days, regardless of current date. but again its up to you. because I cant predict the mentality of your client base. sometimes clients get to annoyed by very small things...
|
|
|
|
|
thanks a lot for help
cheers
|
|
|
|
|
Hi
I ran into a strange issue. I am able to put gridview inside asp:panel and scrolling works too. But the moment I down, the header of gridView scrolls above inside the panel and gets hidden.
I just want to scroll rows, not the header. How can I do that? Please advise. Following is what I am using.
On a side note, I have tried to wrap gridView in DIV but div doesn’t show the scroll bars in the first load for some reason.
Thanks
<asp:Panel ID="Panel1" runat="server" ScrollBars="Both" Height="200" Width="60%">
<asp:GridView ID="GvBidLists" AllowSorting="true" AllowPaging="false" runat="server"
AutoGenerateEditButton="true" DataKeyNames="ListId" EmptyDataText="No data available."
AutoGenerateColumns="False" >
<EditRowStyle BackColor="skyblue" />
<HeaderStyle BackColor="LightSteelBlue" ForeColor="#0000C0" Height="20px" HorizontalAlign="Center" />
<RowStyle Height="20px" VerticalAlign="Middle" />
<FooterStyle BorderColor="White" Height="20px" HorizontalAlign="Center" />
<Columns>
<asp:BoundField HeaderText="ListId" DataField="ListId" SortExpression="ListId" />
<asp:BoundField HeaderText="ListName" DataField="ListName" SortExpression="ListName" />
<asp:BoundField HeaderText="ProductTypeName" DataField="ProductTypeName" SortExpression="ProductTypeName" />
<asp:BoundField HeaderText="Size" DataField="Size" SortExpression="Size" />
</Columns>
</asp:GridView>
</asp:Panel>
Follow your goals, Means will follow you ---Gandhi---
|
|
|
|
|
have you seen this?[^]. There are many more examples at here[^]
|
|
|
|
|
Yusuf wrote: have you seen this?[^].
Have you seen the solution given there? There is nothing that would freeze a grid header in that css.
|
|
|
|
|
No I did not try that example. Nor did I made any claim as far as it working. If you see the second link it was to LMGTFY.
|
|
|
|
|
Yep... got that... was sort of a FYI to you!
|
|
|
|
|
Try:
Step 1 : Create a CSS class as following
.HeaderFreez
{
position:relative ;
top:expression(this.offsetParent.scrollTop);
z-index: 10;
}
Step 2 Set Gridview’s HeaderStyle CssClass as CssClass="HeaderFreez"
|
|
|
|
|
Hello,
I have some controls created at ItemDatabound. (created at itemdatabound because at item databound , i know which type of control to create).
In these controls, i have a button which increases size according to its Text. i want to fix the size for all other controls based on size of this button but when i get the width of button, it gives me 0 pixels.
Can anybody provide an idea on how to set the width for the rest of the controls.
i have tried grid's pre render method but somehow i cant find any of the controls created in itemdatabound .
Thanks
Mark
|
|
|
|
|
You need to do one thing.
Just change size of every dependent controls when the size of your button
changed. Not on ItemDataBound event.
You can use load event for the same.
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
what is photosynthesis example like bingmaps site
j somasekhar
|
|
|
|
|
If you look at a photosynth on Bing there are links under More Information that tell you how it works, and how to create your own. What the application does is take a large number of photographs and combine them to create a panoramic image. When you move your mouse over it the white polygons represent the individual photos that were used.
|
|
|
|
|
Is there a way to add source-structured inputs dynamically to html through c#?
I'm adding inputs (HtmlGenericControls) dynamically to an ASP.NET.
If I have 10 inputs I'd like to "view source" and see them neatly stacked on top of each other instead of rendered back-to-back in a big block.
I've tried adding the following literal controls after each input in the loop but it doesn't seem to do anything:
LiteralControl newLine = (new LiteralControl(((char)10).ToString()));
LiteralControl carriageReturn = (new LiteralControl(((char)13).ToString()));
Do you know if there's a way to do what I'm trying to do?
|
|
|
|
|
What does it matter what the "view source" view looks like? How it is rendered is what is important.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Well first of all i have to agree with Mark Nischalke, really how the HTML is formatted is irrelevant it only matters how the browser is rendering it.
Having said that, I noticed in your code sample that you are creating the controls but not actually adding it to a place holder (which is how you should be dynamically adding controls to a web form) so maybe try adding your controls to a place holder and the HTML should render based on the order they were added to the place holder.
If at first you don't succeed ... post it on The Code Project and Pray.
|
|
|
|