|
Hi,
I have a dategrid were i have a link button for delete.
In the item data bound i am adding an onclick atribute for the link button to popup the msgbox. In Item command I am writing the logic for delete..
the columns in the grid are dynamically created from the codebehind and not in the design part...
My problem is when I click the delete link I am geting the msgbox..If I click ok the page is not posted back to the server and the row is also not deleted...
in Item data bound the code is :
((LinkButton)e.Item.Cells[9].Controls[0]).Attributes.Add("onclick","javascript:return ConfirmDelete();");
the javascript added in the .aspx part is :
function ConfirmDelete()
{
if(confirm('Do You Want to Delete?'))
{
return true;
}
return false;
}
Regards,
Sivaprasad
|
|
|
|
|
The code seems to correct to me. I think the page should get postback.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Hi Members,
I got one requirements from my client.
We have functionality to send the mail from various formats.
My client gave the various structure of email content. So we can use this structure to send the mail from those templates and some of value from SQL Server DB Tables.
So I like to send the mail message from XML Document Message, so that client can change the message content at times as it requires.
So how can I precede the Email Template using XML in ASP.NET 2.0 using C#.
Can you any one helps me with sample code?
With Regards
Sundar
B.Sundarapandian
|
|
|
|
|
Hi,
I have created template according to our client req.
<template>
I hope this will help........
Regards,
Nagraj
|
|
|
|
|
Hi guys,
can anyone help me with this,
I need to browse the folders ,the sub folders of a directory on a machine and find all the pdf files.
Thanx
|
|
|
|
|
This works in C#, should work in ASP.NET in the machine also.
using System.IO;<br />
<br />
FileInfo[] FI = new DirectoryInfo(strDir).GetFiles("*.pdf", SearchOption.AllDirectories);
This will search in the sub dirs also.
good-luck.
NaNg.
|
|
|
|
|
Hi,
you can use the DirectoryInfo and FileInfo classes for this. Use for each statements to iterate through Files collection of DirectoryInfo class and also apply the same logic for each directory under the main directory.
This would definetly do the trick ( i think )
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
1. I'm looking for a way to detect from where the surfer is from.
I know google has such a thing and they can tell me from what country, region and even city I live in.
I know that in C# it something with colture.
How can I do it in ASP.NET?
2. I have an ASP.NET page, that opens a new ASP.NET page with a js cmd (window.open()).
How can I refresh the first page, when the second one closes? do I need to use a different cmd?
|
|
|
|
|
Hi,
NaNg15241 wrote: 1. I'm looking for a way to detect from where the surfer is from.
I know google has such a thing and they can tell me from what country, region and even city I live in.
You can easily get the IP of the "surfer". From this IP you can get the location of the client.
Try reading the link below. Here are some tips.
http://www.private.org.il/IP2geo.html
Hope i am clear
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
here my problem is i need to display records of next,previous.if i click previous it should show upto first record like that.
using datagrid and repeater or anything else
kissy
|
|
|
|
|
You need to store the data in the dataset and just have to navigate the recordset according to the navigation button clicks.
Best Regards,
Apurva Kaushal
|
|
|
|
|
Dim ds As New DataSet
Dim cmddtr As SqlDataAdapter
Dim cmdselect As SqlCommand
//opening connection
cmddtr = New SqlDataAdapter("select * from Division where Divi_id=7", dbconn)
cmddtr.Fill(ds, "Division")
DG.DataSource = ds
DG.DataMember = "Division"
DG.DataBind()
dbconn.Close()
This will work for a all the records to be display,but my need is ,when i click on buttonnext,it should show one by one record in the datagrid.no need of at a time all the records display,but each time when i click next it should go for the next record.likewise previous.
kissy
|
|
|
|
|
If you want to use a datagrid then you can go for paging and there you can set the page size to 1. That way you will get the one record per page and then navigation links.
Best Regards,
Apurva Kaushal
|
|
|
|
|
i have this code placed on itemcommand of the datagrid..
<br />
If (e.Row.RowType <> DataControlRowType.Pager And e.Row.RowType <> DataControlRowType.Header) Then<br />
msClientCode = e.Row.Cells(1).Text<br />
msClientName = e.Row.Cells(2).Text<br />
msClientType = e.Row.Cells(3).Text<br />
End If<br />
how do i convert it to a gridview?
what should i use rowcommand or rowbound?
the code simply gets the selected item then puts the values of the fields into the variables..
anyone knew how to?
thanks..
|
|
|
|
|
anyways i figured it out.. i put this line of code in the rowcommand of thr gridview..
<br />
If (e.CommandName = "Select") Then<br />
Dim row As GridViewRow<br />
<br />
row = gvList.Rows(Convert.ToInt32(e.CommandArgument))<br />
<br />
msClientCode = row.Cells(1).Text<br />
msClientName = row.Cells(2).Text<br />
msClientType = row.Cells(3).Text<br />
<br />
End If<br />
|
|
|
|
|
Hi... Good day.
I have a question, in my page bottom part, it have 5 buttons with different function. One of the button is use for print. I use window.print() function for printing the page.
My question is, when i click the print button to print the page, i want all of the 5 buttons hide from the page and after i finish print the page or close the print window, i want those 5 buttons appear back in the page. Anyone have idea how to do this? Thanks...
Best Regards,
Pei Sun
|
|
|
|
|
Hi,
In the event handler for print button write code like this ---
button1.Visible = false
button2.Visible = false
button3.Visible = false
button4.Visible = false
// your printing code goes here
button1.Visible = true
button2.Visible = true
button3.Visible = true
button4.Visible = true
If you are using some panel or something like that to hold the buttons then you can iterate through the controls collection to set this property. It would be a better programming practice. You can also write a function for this, with 2 args, parent control ( like panel ) and child control to be set visible false. ( just an example )
<marquee>"A good programmer is someone who looks both ways before crossing a one-way street." -- Doug Linder
Anant Y. Kulkarni
|
|
|
|
|
|
Thanks for your reply. I'm not familiar with css. Can you explain further about the link uyou recommend me to read? I'm not so sure how it works. Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
|
Hi Friends,
I want to add controls dynamically to the form at any position as i wish.For that i want to identify the location on the form(page).How to do it in asp.net 2.0 . I know that so many talented people are here to help us.Please post a better solution for this as soon as possible.
Thankyou to one and all,
Regds,
Hari.
|
|
|
|
|
Hi Friends,
This is HariBabu, I want to drag items from one listbox and drop it in another listbox. I want code for this fuctionality in asp.net with c#. i know so many talented guys are here to help me.
Thankyou Guys(Also Ladies)
Regds,
Hari.
HariBabu Kuricheti
|
|
|
|
|
|
Hi Naveed Kamboh,
Thanks for giving response and i saw the examples which you send to me ,it is some what helpful for me, but is there any perfect code for that type of functionality in webapplications(Asp.net 2.0 c#).If any Please send to me .
Anyway Thanks for your contribution.
Regds,
Hari.
|
|
|
|
|
I have a column which is an edit button in datagrid , i want it invisible when the page load , and when i press another click button, the edit button inside the datagrid become visible ? I need to code it in HTML more better ,not in code-behind, thanks you very much.
Best regards,
Chee ken
|
|
|
|