|
Thanks, I will have a look at this control.
|
|
|
|
|
Dear All,
I am creating an web project not an web site.
It includes a module for News, the user can add images for the news.
I am able to add it in the folder in my applicaiton.
But while viewing, i am getting the path as Server.Mappath("<imagename>".
While debugging it is getting the path correctly, but it is not displaying the image.
Can any one tell me a solution to get rid of this?
Thanks a lot in advance.
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Can you please put the code block for that sections?
|
|
|
|
|
Hi,
I have a problem with my divs. I have created an Accordian Ajax Control from the Ajax Control Toolkit. This control when one of the tabs is open it overlays on the footer div. I need that the footer changes position according to the size of the accordian component in this div. Im doing the positioning through CSS. Can some one help me on this please? Thanks for your time.
Regards
|
|
|
|
|
In Which browser ?
I also have some problem with the layout in IE6 and IE7. In my case I just assigned some value to the "Height" Property and It works fine. Before that It was overlapping.
These are some common problems with IE6 and Accordian.
The AutoSize "Limit" mode works exactly the same as the "Fill" mode for Internet Explorer 6 and 7 because they do not support the max-height CSS property.
If you place the Accordion inside a <table> tag and have FadeTransitions set to true in Internet Explorer 6, it will affect the spacing between Accordion Panes.
|
|
|
|
|
Yes with IE7. The thing is that the div that the accordian is in does not change size when the accordian changes size so i can't move the footer down.
ill probably do like as you say.
Thanks for your help.
|
|
|
|
|
before footer div write an empty div with style property clear:both it will solve your problem....
umerumerumer
|
|
|
|
|
I implemented the div but it didnot work. Thanks for your help anyway.
|
|
|
|
|
hi everyone...
iam working on gridview with checkboxes... iam executing my code without any Errors. i can check/uncheck the checkboxes but not able to delete the row/rows in Grid on Delete_Click().
According to me there is a problem with DeleteRow Function..
So can anyone helpme out in this regard...
thanx in advance..
Here is my aspx.cs Code:
protected void btnDelete_Click(object sender, EventArgs e)
{
// This variable contains the selected rows in the format 1,2,3
string SelectedRows = GetSelected();
// User defined function that calls the stored proc to delete the selected items
DeleteRows(SelectedRows);
}
public static void DeleteRows(string PTittle)
{
SqlConnection MyConnection = new SqlConnection("server=(local);database=BlogDatabase;UID=sa;PWD=meritinfo;");
SqlCommand MyCommand = new SqlCommand("Delete from Posts where PTittle=@PTittle ", MyConnection);
MyCommand.Parameters.Add(new SqlParameter("@PTittle", PTittle));
MyCommand.CommandType = CommandType.Text;
MyCommand.Connection.Open();
SqlDataReader dr = null;
dr = MyCommand.ExecuteReader();
//DataTable Posts = new DataTable();
//DataTable dt = new DataTable();
//dt.Load(dr);
//if (dt != null)
//{
// Posts = dt;
//}
}
|
|
|
|
|
Whether it is getting deleted fro database?
Cheers!!
Brij
|
|
|
|
|
No brij,
its not delete from database...
thanx.....
|
|
|
|
|
use ExecuteNonQuery() for deleting from Database.If it gets deleted then bind again with the Grid
Cheers!!
Brij
|
|
|
|
|
Hi prem,
Use MyCommand.ExecuteNonQuery();
and after deleting Bind the grid again .
Try Karke Dekho , Koi Problem ho toh reply karna
|
|
|
|
|
hi,nishant
MyCommand.ExecuteNonQuery()
is also not giving output...
any other sol plz....
once go through the code:
protected void btnDelete_Click(object sender, EventArgs e)
{
// This variable contains the selected rows in the format 1,2,3
string SelectedRows = GetSelected();
// User defined function that calls the stored proc to delete the selected items
DeleteRows(SelectedRows);
}
public static void DeleteRows(string PTittle)
{
SqlConnection MyConnection = new SqlConnection("server=(local);database=BlogDatabase;UID=sa;PWD=meritinfo;");
SqlCommand MyCommand = new SqlCommand("Delete from Posts where PTittle=@PTittle ", MyConnection);
MyCommand.Parameters.Add(new SqlParameter("@PTittle", PTittle));
MyCommand.CommandType = CommandType.Text;
MyCommand.Connection.Open();
//SqlDataReader dr = null;
//dr = MyCommand.ExecuteReader();
//dr.Close();
MyCommand.ExecuteNonQuery();
//DataTable Posts = new DataTable();
//DataTable dt = new DataTable();
//dt.Load(dr);
//if (dt != null)
//{
// Posts = dt;
//}
}
|
|
|
|
|
Aise Likho
SqlConnection MyConnection = new SqlConnection("server=(local);database=BlogDatabase;UID=sa;PWD=meritinfo;");
SqlCommand MyCommand = new SqlCommand("Delete from Posts where PTittle=@PTittle ", MyConnection);
MyCommand.Parameters.Add(new SqlParameter("@PTittle", PTittle));
MyCommand.CommandType = CommandType.Text;
MyCommand.Connection=MyConnection;
MyConnection.open();
MyCommand.ExecuteNonQuery();
Aise Chala kar ke Dekho
|
|
|
|
|
sorry yaar ,
still not...
i think in DeleteRow(______), the parameter should empty
couz connection and commands are all ok..
what do u think..
thank for ur help....
|
|
|
|
|
Are u sending string of Selected Rows like
Ptittle="1,2,3,5" Like this ???
If like that then ur Delete Query dosen't work
becuase it will be like that
"Delete from Posts where Ptittle=1,2,3,5"
This won't work
Write like that
"Delete from Posts where Ptittle In ("+@Ptittle+")"
mein Salah doonga ki
Debug the Code and see What is the Command text
|
|
|
|
|
see yaar.
at MyCommand.ExecuteNonQuery ....SqlException raised--->Incorrect Syntax near ','
command text=
Delete from Posts where PTittle In (,)
|
|
|
|
|
good evening ,
i am trying new code now....here i can bring all checkbox selected fields PTittle value in a string gvID's...and passing to delete command...
but at ExecuteNonQuery() the Error raised that Incorrect Syntax near gvID's value...(for eg:Political Influence on Students is the value in
the string contains PTittle Values Collection...saying Syntax Error near Influence....
Here is the Code: .aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" DataKeyNames="PTittle">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" id="CheckAll" onclick="return check_uncheck (this );" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="tittle" Visible="false"
Text='<%# DataBinder.Eval (Container.DataItem, "PTittle") %>' runat="server" />
<input type="checkbox" id="deleteRec" onclick="return check_uncheck (this );" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Author" HeaderText="Author" SortExpression="Author" />
<asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
<asp:BoundField DataField="PTittle" HeaderText="PTittle" SortExpression="PTittle" />
<asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="Tags" HeaderText="Tags" SortExpression="Tags" />
<asp:BoundField DataField="PStatus" HeaderText="PStatus" SortExpression="PStatus" />
<asp:BoundField DataField="TotalComments" HeaderText="TotalComments" SortExpression="TotalComments" />
</Columns>
</asp:GridView>
<asp:Button ID="Button1" runat="server" OnClientClick="return confirmMsg(this.form)" Text="Button" OnClick="Button1_Click" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:BlogDatabaseConnectionString %>"
SelectCommand="SELECT [Author], [Date], [PTittle], [Category], [Tags], [PStatus], [TotalComments] FROM [Posts]">
</asp:SqlDataSource>
</div>
</form>
</body>
</html>
<script type="text/javascript" language="javascript" >
function check_uncheck(Val)
{
var ValChecked = Val.checked;
var ValId = Val.id;
var frm = document.forms[0];
for (i = 0; i < frm.length; i++)
{
if (this != null)
{
if (ValId.indexOf('CheckAll') != - 1)
{
if (ValChecked)
{
frm.elements[i].checked = true;
}
else
{
frm.elements[i].checked = false;
}
}
else if (ValId.indexOf('deleteRec') != - 1)
{
if (frm.elements[i].checked == false)
{
frm.elements[1].checked = false;
}
}
}
}
}
function confirmMsg(frm)
{
for (i = 0; i < frm.length; i++)
{
if (frm.elements[i].name.indexOf("deleteRec") != - 1)
{
if (frm.elements[i].checked)
{
return confirm("Are you sure you want to delete your selection(s)?")
}
}
}
}
</script>
Here is the Code: .aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
string gvIDs = "";
bool chkBox = false;
//'Navigate through each row in the GridView for checkbox items
foreach (GridViewRow gv in GridView1.Rows)
{
HtmlInputCheckBox deleteChkBxItem = (HtmlInputCheckBox)gv.FindControl("deleteRec");
if (deleteChkBxItem.Checked)
{
chkBox = true;
// Concatenate GridView items with comma for SQL Delete
gvIDs += ((Label)gv.FindControl("tittle")).Text.ToString() + ",";
}
}
SqlConnection cn = new SqlConnection(SqlDataSource1.ConnectionString);
if (chkBox)
{
// Execute SQL Query only if checkboxes are checked to avoid any error with initial null string
try
{
//string deleteSQL = "DELETE from Posts WHERE PTittle IN (" + gvIDs.Substring(0, gvIDs.LastIndexOf(",")) + ")";
SqlCommand cmd = new SqlCommand("DELETE from Posts WHERE PTittle IN (" + gvIDs.Substring(0, gvIDs.LastIndexOf(",")) + ")", cn);
cn.Open();
cmd.ExecuteNonQuery();//Error:After ExecuteNonQuery
GridView1.DataBind();
}
catch (SqlException err)
{
Response.Write(err.Message.ToString());
}
finally
{
cn.Close();
}
}
}
}
|
|
|
|
|
Is there any remort logger file for remote desktop connection? I have to handle add/update/deletion of the log details.
Is it possible?Plz advice and update me.
Muthu
|
|
|
|
|
Pls be so kind to use google with the query: "log4net"...
|
|
|
|
|
I think you can get details using WMI. but why in Asp.net ?
|
|
|
|
|
Is there any build-in function available in .Net framework, which accepts some number and returns a string
value equalent to the number?
[For ex: ReturnEqualentWord(int num); while passing, 5, it should return me Fifth,while 12, it should result twelve or twelvth.]
Muthu
|
|
|
|
|
|
.Net framework doesn't provide this but you can make your own custom function.
Cheers!!
Brij
|
|
|
|