|
I'm trying to get a DIV to display at will, as a sort of dialog, but I'm stuck on setting the visibility as follows. Please could someone suggest why this isn't working:
<br />
function showSearchAndReplace()<br />
{<br />
var dSr = document.getElementById("divSR");<br />
dSr.style.display="inline";<br />
debugger; <br />
return true;<br />
}<br />
My DIV is marked up as:
div id="divSR" style="display: none;"
Last modified: 2hrs 53mins after originally posted --
|
|
|
|
|
I want to bind column name to a dropdownlist.
For ex. A table contains 3 columns "first name", "last name" and "address".
I want to bind those columns to a dropdownlist.I mean to say that that column should appear in the dropdownlist.(i am binding column by Store procedure.).
Can you suggest me how it can be done.
Regars.
Pranav Dave
|
|
|
|
|
You can only bind one of the columns, not all three to the same dropdown, unless you concatenate them in your stored proc, or elsewhere prior to binding.
only two letters away from being an asset
|
|
|
|
|
Hi Developers
I want to cache page's header and footer(which are infact two different user controls) on client's browser. . . !
Any suggestion is this regard..?
|
|
|
|
|
Hi.
I need help reading a file which is created via memory stream.
I know how to read a file (in byte array form) and write to memory stream, but i need to attach this file from the memory stream and email it.
I am doing this to remove the hassles of reading and writing files to disk.
Any help is greatly appreciated.
Thanks
|
|
|
|
|
Just create the attachment from the stream:
Attachment a = new Attachment(theMemoryStream);
The constructor also has overloads so that you can specify file name and mime type.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks, I just found that out.
|
|
|
|
|
Hi All,
I am working with ASP.NET 3.5 (C#) with AJAX. I have a Master Page on which there r horizontal menus. One of the Menu is Search Company which has text box and 2 buttons. First Button Click it pop ups panel which has 3 cascading dropdownlist namely Country, Sector and Sub Industry. Search Company has functionality of either type the name of the Company in the Textbox or filter it from dropdownlist.
I have written Web Service from which data is fetched. Web Service also has 2 functions Auto Complete Extender.
I have a Web User Control which is link to Master Page. This User Control has again have the same search Company mentioned above, but this all is dynamically created on web user control.
Now the problem what I have facing is that I am storing Country Id, Sector ID and Sub Industry ID in Session and in both the text box I get the same company which I don't want. If I am doing filtering part in Master page then its should not reflect on web user control and vice versa.
Someone please help me out with this....
Thanks in advance....
|
|
|
|
|
Hi all,
I am using ajax 1.0 ,asp.net2.0 , C#.
I used nested updatepanel so that only part of page get refereshed but my problem is whole page is getting referesh or flicker(whole page goes off that is no control is visible then it comes back with control and data ) on every event(like seletedindexchaged event)
I here encloesed the code please help
<%@ Page Language="C#" MasterPageFile="~/DailyCallReport/Master2.master" AutoEventWireup="true" CodeFile="Dcr.aspx.cs" Inherits="DailyCallReport_Dcr" Title="Daily Call Report" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
<h2 style ="text-align :center ;" ><asp:Label ID="headername" Font-Size ="12pt" runat="server" Text="D a i l y C a l l R e p o r t"></asp:Label>
</h2>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel id="UpdatePanelmain" ChildrenAsTriggers ="true" UpdateMode ="Conditional" runat="server">
<ContentTemplate>
<asp:Panel ID="MAINPANEL" runat="server" Width= "815 px" BackColor="#FFFFFF" HorizontalAlign = "Left">
<table border = 0 >
<tbody >
<tr style ="background-color:#85C8D0 " align ="left" >
<TD style="WIDTH: 100px; BORDER-BOTTOM: gray 1px solid; height: 28px;" align=right >
<asp:Label id="Label3" runat="server" Text="Day Type" Font-Size="9pt" SkinID="LABEL_Navy_Simple"></asp:Label>
</TD>
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN: left; width: 180px; height: 28px;">
<asp:DropDownList id="Ddldatetype" runat="server" Width="165px" Font-Bold="False" Font-Size="9pt" Font-Names="Arial" SkinID="DROPDOWNLIST_LONG" >
</asp:DropDownList>
</TD>
<td style ="width:280px;" >
</td>
<TD style="WIDTH: 58px; BORDER-BOTTOM: gray 1px solid; height: 28px;" align=right>
<asp:Label id="Label2" runat="server" Text="Date" Font-Size="9pt" Font-Names ="Arial" SkinID="LABEL_Navy_Simple"></asp:Label>
</TD>
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN: left; width: 180px; height: 28px;">
<asp:TextBox ID="Txtreportingdt" runat="server" SkinID ="Textbox"></asp:TextBox>
</TD>
</tr>
</tbody>
</table>
<table border = 1 >
<tbody >
<TR style ="background-color :#B1CCDF" >
<asp:UpdatePanel id="UpdatePanel1" ChildrenAsTriggers ="False" UpdateMode ="Conditional" runat="server">
<ContentTemplate>
-- some code here
</ContentTemplate>
</asp:UpdatePanel>
</tbody>
</table>
<table >
<tbody >
</TR>
<tr style ="background-color :#B1CCDF" >
<TD style="WIDTH: 58px; BORDER-BOTTOM: gray 1px solid; height: 26px;" align=right>
<asp:Label id="Label5" runat="server" Text="Hospital" Font-Size="9pt" SkinID="LABEL_Navy_Simple"></asp:Label>
</TD>
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN: left; width: 250px; height: 26px;">
<asp:DropDownList id="DDLhosp" runat="server" Width="240px" Font-Bold="False" Font-Size="9pt" Font-Names="Arial" AppendDataBoundItems="True" AutoPostBack="True" OnSelectedIndexChanged="DDLhosp_SelectedIndexChanged" ></asp:DropDownList>
</TD>
<TD style="WIDTH: 58px; BORDER-BOTTOM: gray 1px solid; height: 26px;" align=right>
<asp:Label id="Label6" runat="server" Text="Customer" Font-Size="9pt" SkinID="LABEL_Navy_Simple"></asp:Label>
</TD>
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN: left; width: 230px; height: 26px; " colspan = "3">
<asp:DropDownList id="Ddlcust" runat="server" Width="220px" Font-Bold="False" Font-Size="9pt" Font-Names="Arial" AppendDataBoundItems="True" AutoPostBack="True" ></asp:DropDownList>
</TD>
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN: left; width: 132px; height: 26px;">
<asp:CheckBoxList ID="CheckBoxList1" runat="server" Width = "125 px" Font-Names ="Arial" Font-Size ="9 pt" OnSelectedIndexChanged = CheckBoxList1_SelectedIndexChanged AutoPostBack ="true" RepeatDirection="Horizontal">
</asp:CheckBoxList>
</TD>
<TD style="WIDTH: 58px; BORDER-BOTTOM: gray 1px solid; height: 26px;" align="center" >
<%--<asp:Label id="Label11" runat="server" Text="Worked With" Font-Size="9pt" SkinID="LABEL_Navy_Simple"></asp:Label>--%>
<asp:ImageButton ID="Imgbtnworked" runat="server" ImageUrl="~/DailyCallReport/FrameImg/icon/Users26X26.gif" AlternateText="Worked With" /></td>
</TD>
</tr>
</tbody>
</table>
<!-- SECOND TABLE -->
<asp:UpdatePanel id="UpdatePanel5" ChildrenAsTriggers ="true" UpdateMode ="Conditional" runat="server">
</ContentTemplate>
<asp:UpdatePanel id="UpdatePanel2" ChildrenAsTriggers ="true" UpdateMode ="Conditional" runat="server">
<ContentTemplate>
some control code here
</ContentTemplate>
</asp:UpdatePanel>
</tr>
<tr style ="background-color :#C0E3DD">
<asp:UpdatePanel id="UpdatePanel3" ChildrenAsTriggers ="true" UpdateMode ="Conditional" runat="server" >
<ContentTemplate >
---some control here
</ContentTemplate>
</asp:UpdatePanel>
</tr>
<tr style ="background-color :#C0E3DD" >
<asp:UpdatePanel id="UpdatePanel4" ChildrenAsTriggers ="true" UpdateMode ="Conditional" runat="server">
<ContentTemplate>
<some control here>
</ContentTemplate>
</asp:UpdatePanel>
</tr>
<tr style ="background-color :#85C8D0 ">
<TD style="BORDER-BOTTOM: gray 1px solid; TEXT-ALIGN:center ; " colspan ="4" >
<asp:Button ID="Button1" runat="server" SkinID ="BUTTON_LONG" Text="Save Draft" OnClick="Button1_Click1" />
<asp:Button ID="Btncancel" runat="server" OnClick="Btncancel_Click" Text="Cancel" />
</TD>
</tr>
</tbody>
</table>
<table style="width: 814px" >
<tbody >
<tr>
</tr>
<tr>
<td style="width: 825px" >
<asp:Panel ID = "gridpanel" runat="server" Width="800 px" Height="175px" ScrollBars="Both" BorderWidth="1px" BorderStyle="Solid" BorderColor="#99CCCC">
<asp:GridView ID="Grdmain" Width ="806px" AutoGenerateColumns="False" CellPadding="4" DataKeyNames ="DocTORcode"
BackColor ="#C0E3DD" runat="server" OnRowDataBound="grdmain_rowDataBound" OnRowDeleting="grdmain_RowDeleting" OnRowEditing="grdmain_RowEditing">
</asp:GridView>
</asp:Panel>
</td>
</tr>
<tr style ="background-color :#85C8D0 ">
<td style="height: 13px; width: 825px;">
<asp:ImageButton ID="btnclose" runat="server" OnClientClick ="javascript: return confirm('Do you want to delete the record?');" OnClick="btnclose_Click" Width="84px" AlternateText="Close the Day" Height="47px" /></td>
</tr>
</tbody>
</table>
<asp:HiddenField ID="HiddenField1" runat="server" />
</asp:Panel>
<ajaxToolkit:RoundedCornersExtender ID="RoundedCornersExtender1" BorderColor = "#C0E3DD" runat="server" TargetControlID="MAINPANEL" Radius="20" >
</ajaxToolkit:RoundedCornersExtender>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
regards
imran khan
|
|
|
|
|
hi
i want datarelation between 3 tables.
i am using asp.net with c#.
my code is---
but i didn't know about binding the data in farpoint spreadsheet.
-------------------------------------------------------------------------
public DataSet funFillDataset()
{
SqlDataAdapter sqlDaSector;
SqlDataAdapter sqlDaAsset;
SqlDataAdapter sqlDaSectorAsset;
SqlConnection sqlcon = new SqlConnection("Data Source=COMP3\\TIPL1;Initial Catalog=eERS;User ID=gayatri; Password=gayatri");
sqlcon.Open();
sqlDaSector = new SqlDataAdapter();
SqlCommandBuilder cmdbuild = new SqlCommandBuilder(sqlDaSector);
ds = funGetDataSet(ds, sqlcon, sqlDaSector, "select * from tSectorMaster", "tSectorMaster");
sqlDaSectorAsset = new SqlDataAdapter();
ds = funGetDataSet(ds, sqlcon, sqlDaSectorAsset, "select * from tAssetSectorMap", "tAssetSectorMap");
sqlDaAsset = new SqlDataAdapter();
ds = funGetDataSet(ds, sqlcon, sqlDaAsset, "select * from tAssetMaster", "tAssetMaster");
sqlcon.Close();
return ds;
}
public DataSet funGetDataSet(DataSet ds,SqlConnection sqlcon , SqlDataAdapter sqlDA, string query, string tablename)
{
//sqlcon.Open();
sqlDA.SelectCommand = new SqlCommand(query, sqlcon);
sqlDA.Fill(ds, tablename);
return ds;
}
void CreateDataRelations(ref DataSet ds)
{
DataColumn childCol;
DataRelation rel;
DataColumn parentCol;
parentCol = ds.Tables["tSectorMaster"].Columns["SectorCode"];
childCol = ds.Tables["tAssetSectorMap"].Columns["SectorCode"];
rel = new DataRelation("AssetSectorMap1", parentCol, childCol);
rel.Nested = true ;
ds.Relations.Add(rel);
DataColumn parentCol, childCol;
parentCol = ds.Tables["tAssetSectorMap"].Columns["AssetCode"];
childCol = ds.Tables["tAssetMaster"].Columns["AssetCode"];
rel = new DataRelation("AssetSectorMap_AssetMaster", parentCol1, childCol1);
rel.Nested = true;
ds.Relations.Add(rel);
}
private void bindDataset(ref DataSet ds)
{
FpSpread1.DataSource = ds;
FpSpread1.DataBind();
FpSpread2.DataSource = ds;
FpSpread2.DataBind();
}
this is my code but its not run.
pls tell me write code.
arya
|
|
|
|
|
|
i didn't understand.
pls help me.
i am new in asp.net 2.0
arya
|
|
|
|
|
He IS helping you. If you can't articulate your problem clearly, we can't help much.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
thanks for reply
sir actually i am using asp.net with c#.
in my web application i take farpoint spreadsheet control.
On that control i want treeview.
-SectorName
Aggriculture
Company name
NagarjunFertilizer
Auto
TataMotors
Honda
IT
Infosys
Wipro
like this Treeview i want on farpoint spreadsheet.
i have 3 tables
1.tSectorMaster
SectorCode(PK)
Description
2.tAssetMaster
AssetCode(PK)
Descriptionlong
3.tAssetSectorMap
AssetSectorCode(PK)
SectorCode(FK)
AssetCode(FK)
and i want
SectorName
Description
Descriptionlong
Description
Descriptionlong
Descriptionlong
Description
Descriptionlong
Descriptionlong
|
|
|
|
|
Hi
I have the following bit of code, basically i am selecting a value from a datbase which is showing as 12.00
DateTime dtlogtime = Convert.ToDateTime(readerdate);
if (dttimenow.AddMinutes(1) > dtlogtime)
{
}
the readerdate is a string and is the value from the database
but i get the error message: String was not recognized as a valid DateTime.
any help would be great
thanks
|
|
|
|
|
Hi
To me it seems "readerdate" is data reader object. if so ,Convert.ToDatetime does not take a reader obejct as input. Select a pecific column of the reader object what I mean is something like this,
<br />
int i=0;<br />
DateTime dtlogtime = Convert.ToDateTime(readerdate[i]);<br />
if (dttimenow.AddMinutes(1) > dtlogtime)<br />
{<br />
}<br />
<br />
Thanks,
Arindam D Tewary
|
|
|
|
|
hi
readerdate being the string value from the database
sorted it
DateTime dtlogtime = Convert.ToDateTime(readerdate);
if (dtlogtime.AddMinutes(1) < dttimenow)
cheers
|
|
|
|
|
Try DateTime.Parse
only two letters away from being an asset
|
|
|
|
|
Hello friends
my question is
How to add a checkbox conrol to datalist or datagrid in single cell(2,2)
thanking you
sam
Final year student of MCA
|
|
|
|
|
U can add that on ItemDataBound Event of DataGrid....
|
|
|
|
|
I am creating application using asp.net and c# and Oracle 10G as database. I am using Nhibernate
When I execeute from query from my page query first time it works fine and also do its job but in the same session if i try to run the same query it is giving me an exception which is
“From Keyword exception”.
The query is written on Command button using a Command button.
I have debugged the code and from the command object I pick up the query and run into SQL developer its running fine.
I also assure as Nhibernate session is also closed.
I also try Global.asax to close the Nhibernate Session.
To start with it looks like session problem which i tried to knock out by closing session, reader, object and also disposing command object.
Any suggestion to resolve this .
Thanks
Waqas
|
|
|
|
|
Dear Friends,
i have created one grid with servral controls on it now i am accessing the data of that control using GridView.FindControl("ControlName") method which is return me the control to access the data but each time i have to follow the process of providing ("ControlName") of that control. Instead of that i want to create an class which can take the gridview as input and provide me the output as "ControlName = ControlValue" as an collection which can be easy to integrate with my Database class can anyone guide me how can i access the control at run time and store the value in my collection
or is there another simple way if any please provide me.
thanks in advance.
Sasmi
|
|
|
|
|
Hello all,
I've been tinkering with a small Content Management System called ScrewTurnVisualizer that I've found on http://blog.lavablast.com/post/2008/01/Dirt-Simple-ASPNET-CMS-using-the-ScrewTurn-Wiki.aspx
I have converted the code for this short program, which was written in C# to VB with a converter I've found online. When I tried to build and run this program in VS2003, I've got more than 3 dozen error messages. I'm wondering if this CMS is written using dotnet 2.0 and if that is why I've been getting so many error messages. If it was indeed written using dotnet 2.0 could you please show me how to convert it so that it is compatible with VS2003? Below is the code that I've got after the C# conversion to VB. Any help will be greatly appreciated and thank you in advance for your time.
<br />
<br />
<br />
<br />
Imports System<br />
Imports System.Collections.Generic<br />
Imports System.ComponentModel<br />
Imports System.Text<br />
Imports System.Web<br />
Imports System.Web.UI<br />
Imports System.Web.UI.WebControls<br />
Imports System.Net<br />
Imports System.IO<br />
Imports System.Text.RegularExpressions<br />
Imports System.Web.Caching<br />
<br />
<br />
Namespace LavaBlast.CustomControls<br />
<defaultproperty("text")> _<br />
<toolboxdata("><{0}:screwturnvisualizer runat="server"></{0}:screwturnvisualizer>")> _<br />
Public Class ScrewturnVisualizer<br />
Inherits WebControl<br />
<bindable(true)> _<br />
<category("data")> _<br />
<defaultvalue("")> _<br />
<localizable(true)> _<br />
Public Property PageName() As String<br />
Get<br />
Dim s As String = DirectCast(ViewState("PageName"), String)<br />
Return (IIf((s Is Nothing),[String].Empty,s))<br />
End Get<br />
<br />
Set<br />
ViewState("PageName") = value<br />
End Set<br />
End Property<br />
<br />
<bindable(true)> _<br />
<category("data")> _<br />
<defaultvalue("")> _<br />
<localizable(true)> _<br />
Public Property BaseURL() As String<br />
Get<br />
Dim s As String = DirectCast(ViewState("BaseURL"), String)<br />
If s IsNot Nothing AndAlso Not s.EndsWith("/") Then<br />
s += "/"<br />
End If<br />
Return (IIf((s Is Nothing),[String].Empty,s))<br />
End Get<br />
<br />
Set<br />
ViewState("BaseURL") = value<br />
End Set<br />
End Property<br />
Public ReadOnly Property FullURL() As String<br />
Get<br />
Return GetFullPath(BaseURL, PageName)<br />
End Get<br />
End Property<br />
<br />
<bindable(true)> _<br />
<category("data")> _<br />
<defaultvalue("")> _<br />
<localizable(true)> _<br />
Public Property CacheText() As Boolean<br />
Get<br />
Return CBool((IIf(ViewState("CacheText") Is Nothing, (ViewState("CacheText") = True), ViewState("CacheText"))))<br />
End Get<br />
Set<br />
ViewState("CacheText") = value<br />
If Not value Then<br />
If Page IsNot Nothing Then<br />
Page.Cache.Remove("ScrewturnVisualizer_" + FullURL)<br />
End If<br />
End If<br />
End Set<br />
End Property<br />
<br />
Public Function GetPageContents() As String<br />
If CacheText AndAlso Me.Page.Cache("ScrewturnVisualizer_" + FullURL) IsNot Nothing Then<br />
Return Me.Page.Cache("ScrewturnVisualizer_" + FullURL).ToString()<br />
End If<br />
<br />
Dim s As String = GetScrewturnPageContent(BaseURL, PageName)<br />
<br />
If CacheText Then<br />
Me.Page.Cache.Add("ScrewturnVisualizer_" + FullURL, s, Nothing, Cache.NoAbsoluteExpiration, New TimeSpan(1, 0, 0), CacheItemPriority.[Default], _<br />
Nothing)<br />
End If<br />
<br />
Return s<br />
End Function<br />
<br />
Public Shared Function GetFullPath(ByVal baseUrl As String, ByVal pageName As String) As String<br />
Return baseUrl + "Print.aspx?Page=" + pageName<br />
End Function<br />
<br />
Public Shared Function GetScrewturnPageContent(ByVal baseUrl As String, ByVal pageName As String) As String<br />
Dim s As String = ""<br />
Try<br />
Dim req As HttpWebRequest = DirectCast(HttpWebRequest.Create(GetFullPath(baseUrl, pageName)), HttpWebRequest)<br />
req.UserAgent = "LavaBlast"<br />
req.CookieContainer = New CookieContainer()<br />
Dim response As HttpWebResponse = DirectCast(req.GetResponse(), HttpWebResponse)<br />
response.Cookies = req.CookieContainer.GetCookies(req.RequestUri)<br />
<br />
Dim reader As New StreamReader(response.GetResponseStream())<br />
s = reader.ReadToEnd()<br />
reader.Close()<br />
<br />
s = Regex.Replace(s, "<a[^>]*>Edit", "", RegexOptions.Compiled)<br />
s = Regex.Replace(s, "^.*<input.*id value=".[^""]*""" />", "", RegexOptions.Compiled Or RegexOptions.Singleline)<br />
s = Regex.Replace(s, ".*$", "", RegexOptions.Compiled Or RegexOptions.Singleline)<br />
s = Regex.Replace(s, "<h1 class=".pagetitle.">[^<]*</h1>", "", RegexOptions.Compiled)<br />
s = Regex.Replace(s, "<h2 class=".seperator.">(?<title>[^<]*)</title></h2>", "<h2>${title}</h2>", RegexOptions.Compiled)<br />
<br />
s = Regex.Replace(s, "GetFile.aspx.File=", "images/", RegexOptions.Compiled)<br />
Catch ex As Exception<br />
System.Diagnostics.Debug.WriteLine([String].Format("An error has occurred accessing {0}.<br />{1}", baseUrl + "Print.aspx?Page=" + pageName, ex.ToString()))<br />
s = "An error has occurred."<br />
End Try<br />
Return s<br />
End Function<br />
<br />
Protected Overloads Overrides Sub RenderContents(ByVal output As HtmlTextWriter)<br />
output.Write(GetPageContents())<br />
End Sub<br />
End Class<br />
End Namespace<br />
<br />
</a[^></localizable(true)></defaultvalue("")></category("data")></bindable(true)></localizable(true)></defaultvalue("")></category("data")></bindable(true)></localizable(true)></defaultvalue("")></category("data")></bindable(true)></toolboxdata("></defaultproperty("text")>
modified on Tuesday, February 26, 2008 7:12 AM
|
|
|
|
|
I am using a Radio button List in my application. The first button is checked by default.
When i enter a search text in a textbox and click the second button if it is null or invalid text it throws an error message....
and the second button is checked ......
I want the first button to be checked if invalid text enters and error message is shown...
the code is attached....
<asp:radiobuttonlist id="rbperspect" runat="server" autopostback="True" font-bold="True"><br />
RepeatDirection="Horizontal" Width="202px" Height="18px" OnSelectedIndexChanged="rbperspect_SelectedIndexChanged"><br />
<br />
<br />
<br />
</asp:radiobuttonlist>
SAJAN A PILLAI
C#.NET Programmer
TELESOFT INDIA PVT LTD...
BANGALORE
"Winners don't do different things. They do things differently. ...
|
|
|
|
|
i have a link button control in the gridview. i have done data binding in this contol
i have an event , row command of the gridview,now the problem is when i click the linkbutton , and if i have stated the postback url property then it is not comming in the row command event.
if i don't use the post back url event , then it is comming in the event.
Y it is happening.
it there any contol that can be used to send in the row command event along with the post back url property
Yesterday is a canceled check. Tomorrow is a promissory note. Today is the ready cash. USE IT.
|
|
|
|
|