|
Html Code of DIV...
<div id="divIP1" runat="server" style="display:none;text-align:left;padding-left:0px;" > ........
Then Server Side Code here...
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
DataUtility dUT = new DataUtility();
string strsql = "Delete FeedBack Where Active=1 and ID='" + id.ToString() + "'";
int result = dUT.ExecuteSql(strsql);
bindDataGrid();
bindDataGrid1();
divIP1.Style["Display"] = "Visible";
}
|
|
|
|
|
Well, that is plain not going to work anyhow, because attributes are case sensitive.
But, I would expect it to work otherwise. Not that I ever do this, there is obviously a wrinkle I don't know about. Did you try using a Panel or PlaceHolder instead of your div ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes i've tried panel and placeholder instead of div..
i am sending complete code to u.....
JS code......
var openDiv='';
function divShowHide(myDiv,myTD)
{
if(openDiv=='')
{
document.getElementById(myDiv).style.display='block';
openDiv=myDiv;
}
else
{
document.getElementById(openDiv).style.display='none';
document.getElementById(myDiv).style.display='block';
openDiv=myDiv;
}
}
Html Code here..............I am calling on Span..
<table id="tableSearch1" cellpadding="0" cellspacing="0" style="width:100%">
<tr class="trClass" >
<td class="tdClass" align="center">
<span class="spanA" onclick="divShowHide('divIP1','TD1');">
Pending Record
</span>
...Div Html Code here...
<div id="divIP1" style="display:none;text-align:left;padding-left:0px;" runat=server >
<table class="tableSearch2" style="width:100%;" cellpadding="2" runat="server">
<tr>
<td align="center">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="ElearningDataGridBody"
DataKeyNames="ID" GridLines="Horizontal" OnRowDeleting="GridView1_RowDeleting"
OnRowEditing="GridView1_RowEditing" Width="1000px" OnRowDataBound="GridView1_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" />
</HeaderTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Email" HeaderText="Email" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:BoundField DataField="Comment" HeaderText="Comment" />
<asp:BoundField DataField="Status" HeaderText="Status" />
<asp:TemplateField HeaderText="Show Comment">
<ItemTemplate>
<asp:LinkButton ID="linkShow" runat="server" CommandName="Edit" OnClientClick="return confirm('Do You Really Want To Show This Record');">Show</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Delete">
<ItemTemplate>
<asp:LinkButton ID="linkDelete" runat="server" CommandName="Delete" OnClientClick="return confirm('Do You Really Want To Delete This Record');">Delete</asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<HeaderStyle CssClass="ElearningDataGridHeaderFont" />
</asp:GridView>
</td></tr>
<tr>
<td height="5px"></td></tr>
<tr>
<td align="center">
<asp:Button ID="cmdShow" runat="server" TabIndex="9" Text="Show" OnClick="cmdShow_Click" /> <asp:Button
ID="cmdDelete" runat="server" TabIndex="8" Text="Delete" OnClick="cmdDelete_Click" />
</td>
</tr>
</table>
</div>
.cs code here
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
string id = GridView1.DataKeys[e.RowIndex].Value.ToString();
DataUtility dUT = new DataUtility();
string strsql = "Delete FeedBack Where Active=1 and ID='" + id.ToString() + "'";
int result = dUT.ExecuteSql(strsql);
bindDataGrid();
bindDataGrid1();
divIP1.Style["Display"] = "Visible";
}
Actually i want to do..when we dell the record hen show div..Because i have used 2Div in form..
and i want to show record on click event of button..
|
|
|
|
|
If you use a placeholder, you can set the visibility in your code behind. Tis code still won't work because you're using Display and Visible, when they are lower case. I doubt Visible is a correct value either.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
how should i display tool tip in asp.net
If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!
|
|
|
|
|
Hi,
Use java script like this:
<br />
<script type="text/javascript"><br />
var horizontal_offset="9px"
<br />
var vertical_offset="0"
var ie=document.all<br />
var ns6=document.getElementById&&!document.all<br />
<br />
function getposOffset(what, offsettype){<br />
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;<br />
var parentEl=what.offsetParent;<br />
while (parentEl!=null){<br />
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;<br />
parentEl=parentEl.offsetParent;<br />
}<br />
return totaloffset;<br />
}<br />
<br />
function iecompattest(){<br />
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body<br />
}<br />
<br />
function clearbrowseredge(obj, whichedge){<br />
var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1<br />
if (whichedge=="rightedge"){<br />
var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40<br />
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth<br />
if (windowedge-dropmenuobj.x > dropmenuobj.contentmeasure)<br />
{<br />
edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset)<br />
}<br />
}<br />
else{<br />
var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18<br />
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight<br />
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure)<br />
edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight<br />
}<br />
return edgeoffset<br />
}<br />
<br />
function showhint(menucontents, obj, e, tipwidth){<br />
if ((ie||ns6) && document.getElementById("hintbox")){<br />
dropmenuobj=document.getElementById("hintbox")<br />
dropmenuobj.innerHTML=menucontents<br />
dropmenuobj.style.left=dropmenuobj.style.top=-500<br />
if (tipwidth!=""){<br />
dropmenuobj.widthobj=dropmenuobj.style<br />
dropmenuobj.widthobj.width=tipwidth<br />
}<br />
dropmenuobj.x=getposOffset(obj, "left")<br />
dropmenuobj.y=getposOffset(obj, "top")<br />
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px"<br />
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px"<br />
dropmenuobj.style.visibility="visible"<br />
obj.onblur=hidetip<br />
}<br />
}<br />
<br />
function hidetip(e){<br />
dropmenuobj.style.visibility="hidden"<br />
dropmenuobj.style.left="-500px"<br />
}<br />
<br />
function createhintbox(){<br />
var divblock=document.createElement("div")<br />
divblock.setAttribute("id", "hintbox")<br />
document.body.appendChild(divblock)<br />
}<br />
<br />
if (window.addEventListener)<br />
window.addEventListener("load", createhintbox, false)<br />
else if (window.attachEvent)<br />
window.attachEvent("onload", createhintbox)<br />
else if (document.getElementById)<br />
window.onload=createhintbox<br />
<br />
</script><br />
<br />
<br />
<asp:textbox id="txtTest" runat="server" onfocus="showhint('This ia a test', this, event, '180px')"></asp:textbox><br />
<br />
|
|
|
|
|
Two ways:
1) The TITLE attribute of the HTML element itself shows a rudimentary tooltip.
2) Overlib library: www.bosrup.com/web/overlib/[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Hi friends
I want my page to appear in Center for this in the body tag i have written
style = "left: 10%; position: absolute; top: 0%; height: 10%;
its coming in the Center but bottom scrollbar is appearing and with a wide are to navigate
I mean user can drag the bottom scrollbar to a wider distance
How to make page to appear in Center and Bottom scroll bar must not appear if appears then it must be not drag-able to much extent
Thank You
If You win You need not Explain............
But If You Loose You Should not be there to Explain......
|
|
|
|
|
ALT + F4 wrote: If You win You need not Explain............
But If You Loose You Should not be there to Explain......
If you need some answer you have to explain the problem properly.
*jaans
|
|
|
|
|
in my application i have one textbox ,button and a drop down box.when i am clicking the button it will browse the database and will appear in the text box.i have done that.now what i want is,to fetch the database tables from the browsed database and to list in the dropdown box.
the query for that is
select table_name, column_name, data_type, character_maximum_length, is_nullable from information_schema.columns where table_name in (select name from sysobjects where xtype='U') order by table_name
but i want the c# code for that.where do i put this query?
|
|
|
|
|
hai,
currently i m using ASP.NET with C# (.net 2005, 2.0 framework).
DataColumnCollection t1 = row1.Tables[0].Columns;
the t1 consist of 5 values and i want to rename it (i.e, if t1 contains "Sample1", then i want to change it as "rename_sample1".
how to achieve it? - KARAN
|
|
|
|
|
I want to create a contact page using .Net? I tryed some code but the mail is coming in mailroot/queue folder. Is there any setting???
|
|
|
|
|
I have no idea what you're trying to do. If you send the mail using code, it will go where you send it. And, if you use a mailto: tag, it will go to the address you specify, via the client's mail program.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
|
while asking some question in this forum , you should be more specific on you questions .
asif_3 wrote: ust tell me what we need to do to create contact page?
There is many way to create contat page. but you should be specific that what you need rathere that asking some one in this way .
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
I can't really answer that, because I'm not even sure what you mean by contact page ( that is, its just a page, it may well send mail using the mail server on the server end, but it still seems trivial to me ). It makes more sense for you to tell us what you tried, what you want it to do, etc.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have two dropdown and a gridview, i am getting the result in Gridview by selecting both the dropdown, I want to know how we can Navigate from the Gridview Data to the Gridview or any static page, each data should have different link. and link page should display the details of the data which we are selecting from the data base.
Can Any body Fix this Problem!
|
|
|
|
|
I have no idea what you're asking. You want links in the grid view to navigate to different pages ? Render links in the rows to the pages you want. You want something different, then please try to explain it better.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I got the data in the gridview from database assume i have 5 rows.
in that each row should go to a separate url(should have link) or with same page different data i tried it i am getting the same page again n again
|
|
|
|
|
Do what I said - render URLs in your grid view based on the content of the data in each row. I assume the URL you want relates to the row data in some way ? The obvious way is that query string parameter is set according to the data in the row.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
you can use GridViewRow and a select the data to can pass it to different page on link click. for any link you can use Gridview Template Field.
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
I'm developing an e-commerce web-based system & have problem in Shopping Cart part. i.e. update quantity & delete item from cart. This is code-behind for my Cart.aspx.
<pre>
'other code above
Protected Sub GridView1_RowDeleting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewDeleteEventArgs) Handles GridView1.RowDeleting
cart.DeleteItem(e.RowIndex) 'error here
GridView1.DataBind()
End Sub
Protected Sub GridView1_RowEditing(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewEditEventArgs) Handles GridView1.RowEditing
GridView1.EditIndex = e.NewEditIndex
GridView1.DataBind()
End Sub
Protected Sub GridView1_RowUpdating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles GridView1.RowUpdating
Dim cell As DataControlFieldCell
cell = GridView1.Rows(e.RowIndex).Controls(3)
Dim t As TextBox = cell.Controls(0)
Try
Dim q As Integer
q = Integer.Parse(t.Text)
cart.UpdateQuantity(e.RowIndex, q) 'error here
Catch ex As FormatException
e.Cancel = True
End Try
GridView1.EditIndex = -1
GridView1.DataBind()
End Sub
Protected Sub GridView1_RowCancelingEdit(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCancelEditEventArgs) Handles GridView1.RowCancelingEdit
e.Cancel = True
GridView1.EditIndex = -1
GridView1.DataBind()
End Sub
'other code below
</pre>
The error saying that:
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Thanks for your help!
|
|
|
|
|
miss nadia wrote: cart.DeleteItem(e.RowIndex) 'error here
Where is that function ?
Best Regards
-----------------
Abhijit Jana
"Success is Journey it's not a destination"
|
|
|
|
|
That function is in ShoppingClass class.
|
|
|
|
|
this is the function in ShoppingCart class.
<pre>
Imports Microsoft.VisualBasic
Imports System.Collections.Generic
Public Class ShoppingCart
Private _cart As List(Of CartItem)
Public Sub New()
_cart = New List(Of CartItem)()
End Sub
Public Function GetItems() As List(Of CartItem)
Return _cart
End Function
Public Sub AddItem(ByVal id As String, ByVal name As String, ByVal price As Decimal)
Dim itemFound As Boolean = False
For Each Item As CartItem In _cart
If Item.ID = id Then
Item.Quantity += 1
itemFound = True
End If
Next
If Not itemFound Then
Dim item As CartItem
item = New CartItem(id, name, price, 1)
_cart.Add(item)
End If
End Sub
Public Sub UpdateQuantity(ByVal index As Integer, ByVal quantity As Integer) 'update quantity function
Dim item As CartItem
item = _cart(index)
item.Quantity = quantity
End Sub
Public Sub DeleteItem(ByVal index As Integer) 'delete item function
_cart.RemoveAt(index)
End Sub
Public ReadOnly Property Count() As Integer
Get
Return _cart.Count
End Get
End Property
End Class
</pre>
|
|
|
|