|
MD. SHAHDAT HOSAIN wrote: I use a updatepanel, repeater and usercontrol(profile.ascx).
I think you should use a gridview, which is set up to handle things like delete buttons. I think you should experiment if using AJAX controls is also killing what you're trying to do. I also think you'd have a lot more control if you learned AJAX instead of blindly using the MS library.
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.
|
|
|
|
|
Hello Boss
I also know about Gridwiew. and the problem can be solve by it. But I want to Implement like plax.com's request connection service.
In www.plaxo.com when a user click on request to connect link. A connection connection request send. page automatically updated and when a user click on cross button the deletion also fairly done.
Could you Suggest me more?
shahdat
|
|
|
|
|
|
Use
<asp:Button ID="ConnectionDelete" runat="server" Text="Delete" OnCommand="ConnectionDelete_Click"/>
Inside Repeater, the button.click event is not generated. Rather OnCommand will be evaluated.
Also you can use CommandArgument if you want any arguments while the event is generated.
Inside the eventhandler you can use
e.CommandArgument or e.CommandName to handle the command properly.
Hope this help u.
|
|
|
|
|
Hi,
i would like to know whether there is any way ,
to block the user from copying images from the website other than disabling right clicking using javascript
|
|
|
|
|
Subin Alex wrote: other than disabling right clicking using javascript
This is useless. Anyone can beat it.
There is no way to protect images. If I can view the images on your site, no matter what you try to do, I can copy them.
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.
|
|
|
|
|
I Agree To Christian
Rather U can Keep Copy Right To Ur Website name
U can Do other than tht
|
|
|
|
|
You can disable right click on the page with javascript but some people can get around it.
|
|
|
|
|
Hi,
I bind the gridview to excel in disconnected mode. works fine.
MAke changes to gridview data. changes happen and reflected in dataset.
Try to update the dataset using adapter (to transfer the changes to same excel in connected mode). commandbuilder thorws exception as it is not able to find a primary key in excel sheet. How to do it?
public partial class excel_excel_disconnmode : System.Web.UI.Page
{
OleDbConnection oo;
OleDbDataAdapter adp;
DataSet ds;
protected void Page_Load(object sender, EventArgs e)
{
oo = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:\\ASP1\\Book1.xlsx;Extended Properties=Excel 12.0");
adp = new OleDbDataAdapter("select ID from [Sheet1$]", oo);
if (!IsPostBack)
{
ds = new DataSet();
ViewState["ds"] = ds;
adp.Fill(ds, "sheet1");
GridView1.DataSource = ds;
GridView1.DataBind();
}
else
{
ds = (DataSet)ViewState["ds"];
GridView1.DataSource = ds;
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex; // turn to edit mode
GridView1.DataBind();
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int pos = e.RowIndex;
ds.Tables[0].Rows[pos].Delete();
GridView1.DataBind();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int pos = e.RowIndex;
string name = ((TextBox)GridView1.Rows[pos].Cells[0].Controls[0]).Text;
ds.Tables[0].Rows[pos][0] = name;
GridView1.EditIndex = -1;
GridView1.DataBind();
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
GridView1.DataBind();
}
//to trasnfer the changes from disconnected to connected excel
protected void Button1_Click(object sender, EventArgs e)
{
adp = new OleDbDataAdapter("select ID from [Sheet1$]", oo);
OleDbCommandBuilder xx = new OleDbCommandBuilder(adp);
adp.Update(ds, "sheet1");
}
}
|
|
|
|
|
make any one of the column as primary key in access table in which u want to make updates...
|
|
|
|
|
I have to make change in EXCEL, not ACCESS.
SO how to define a primary key in Excel?
Or any other way to update the excel?
|
|
|
|
|
i am working on HR Project in which all the past and current details of employees shld be present at my project,last i heve seen code in this website alowing checkbox in datagrid there is name space i declaired but when i trying to declair assembly it shows erre that system can not find specified. and where can i get help acording to my HR project ITS apearens [templet] and codes .i have vs 2005 n 2.0 .net framework.
|
|
|
|
|
I am not sure where you are putting this code, or why you expect it to work. There are plenty of articles on using checkboxes in grids.
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.
|
|
|
|
|
Hello All,
I am creating a class in C# for some functionality and later consuming it in my ASP.Net application.
I have written Try-Catch blocks in that class.
If an exception occurs, i want to display some message to user in Alert Box.
I am trying to generate alert box from below code
catch(System.Exception ex)
{
Response.Write("<script>alert('" + ex.Message + "');</script>");
}
But its showing compile time error : "The name 'Response' does not exist in the current context"
Am i missing something?
Thanks,
Nagendra.
modified on Wednesday, September 9, 2009 2:40 AM
|
|
|
|
|
That's odd. Where are you writing this code ? Not in a page class, I assume, otherwise the Response object would be 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.
|
|
|
|
|
Hi,
I am writting this code in a C# class.
But i solved the above error by writting :
catch(System.Exception ex)
{
HttpContext.Current.Response.Write("<script>alert('" + ex.Message + "');</script>");
}
But its not showing Alert Box on exception.
|
|
|
|
|
nagendrathecoder wrote: But its not showing Alert Box on exception.
Are you sure code is hitting the exception? Put a break point and check that first.
|
|
|
|
|
Yes it is showing exception.
Its also going over that alert box code but still alert box is not displayed.
If i am just writing the exception on page like
HttpContext.Current.Response.Write(ex.Message);
its showing the exception but not the alert box.
|
|
|
|
|
Use this....
Page page = HttpContext.Current.Handler as Page;
if (page != null)
{
ScriptManager.RegisterStartupScript(page, page.GetType(), "msg", "alert('Hi..')", true);
}
|
|
|
|
|
I tried but its showing error: "The name 'ScriptManager' does not exist in the current context"
|
|
|
|
|
Everyone is assuming you're writing script inside your page. That you're not, is bad design. You should fix that, catch the exception in your presentation layer, and do it there. I agree, using the script manager is a good idea. It is an object on the page class, so you can access it that way.
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.
|
|
|
|
|
nagendrathecoder wrote: But i solved the above error by writting :
Yeah, that looks like it could work. However, it's bad form for your non presentation layer to be pumping out HTML. You'd do better to catch the exception in the presentation layer and put your code there.
nagendrathecoder wrote: But its not showing Alert Box on exception.
Have you checked the HTML to make sure your javascript is being inserted ?
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, now i am passing my exception as a string to presentation layer and trying to show alert box there, but its still not working.
|
|
|
|
|
OK, did you do the other stuff I suggested ? I agree with the person who said to use RegisterClientScriptBlock. Then you need to check to see if the script is being passed into the HTML or not. If it's not there, then that's your issue. if it is, you need to work out why it does not display ( I would have expected it to )
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.
|
|
|
|
|
I am getting this string as my script
string msg ="<script language=JavaScript>alert('Violation of PRIMARY KEY constraint 'PK_BOMDetail'. Cannot insert duplicate key in object 'dbo.BOMDetail'.\r\nThe statement has been terminated.');</script>";
RegisterClientScriptBlock("Hello", msg);
Its still not showing.
|
|
|
|