|
Its a bit tough to determine from your post exactly what you are trying to accomplish. The way I interpret it, there are 3 approaches that you might consider, depending on your needs.
The easiest way would be to simply force a postback with the row data each time you need to add to the grid. Your pop-up dialog could populate hidden textboxes that contain the row's information, and then use client side script to submit. The downside to this is that it is a very poor user experience.
Another way would be to use the DOM and client scripting to dynamically control the table on the client side. An example of this approach, with client script can be found here[^]. If that one isn't to your liking, many others can be found on the web. There are two downsides that I see to this method. First, older browsers will not support it. Secondly, the client manipulations will not be sent to the server. You would need to come up with a means of tracking the client side changes so that you could parse them on a postback.
Yet another option would be to use an AJAX-enabled interface to process handle the requests on the server in a real-time manner without degrading the user experience. There are plenty of this approach on the web, such as this[^] one. It may also be worth your time to check into a third party control to make this easier for you. Again, there are many to choose from, such as this[^] one that I've randomly selected.
If I were implementing it, I would probably go with a blend of the second and third methods. I would perform client side manipulation to the table directly and fire off an async request to the server to track the changes at the same time. In my opinion, that would give the best user experience without having to resort to dirty tricks to "remember" the sequence of changes as they occur.
Hopefully, that provides enough help to get you started. Best of luck.
--Jesse
|
|
|
|
|
with this code i could play video on my web page. but it just plays given file "C:\Inetpub\wwwroot\myProjectFolder\UserControl.wmv" how can i send file name ? i mean user will choose a file name which is already exist in the project folder and the choosen file will be played
<object id="play" style="WIDTH: 510px; HEIGHT: 370px" classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6"
="" name="play" viewastext="">
PARAM NAME="URL" VALUE="C:\Inetpub\wwwroot\myProjectFolder\UserControl.wmv">
PARAM NAME="rate" VALUE="1">
PARAM NAME="balance" VALUE="0">
PARAM NAME="currentPosition" VALUE="0">
PARAM NAME="defaultFrame" VALUE="">
PARAM NAME="playCount" VALUE="1">
PARAM NAME="autoStart" VALUE="0">
PARAM NAME="currentMarker" VALUE="0">
PARAM NAME="invokeURLs" VALUE="-1">
PARAM NAME="baseURL" VALUE="">
PARAM NAME="volume" VALUE="50">
PARAM NAME="mute" VALUE="0">
PARAM NAME="uiMode" VALUE="full">
PARAM NAME="stretchToFit" VALUE="0">
PARAM NAME="windowlessVideo" VALUE="0">
PARAM NAME="enabled" VALUE="-1">
PARAM NAME="enableContextMenu" VALUE="-1">
PARAM NAME="fullScreen" VALUE="0">
PARAM NAME="SAMIStyle" VALUE="">
PARAM NAME="SAMILang" VALUE="">
PARAM NAME="SAMIFilename" VALUE="">
PARAM NAME="captioningID" VALUE="">
PARAM NAME="enableErrorDialogs" VALUE="0">
PARAM NAME="_cx" VALUE="11007">
PARAM NAME="_cy" VALUE="8043">
OBJECT>
openup your heart and let the sun shine in
-- modified at 5:23 Wednesday 28th June, 2006
|
|
|
|
|
i solved the proble i am using this code
<param name="URL" value="<%=gelen%>" />
gelen is a public variable . i am giving it the path in any event for ex.
in button_click event
{
gelen = "c:/film.wmv";
}
when a user clicks this button film.wmv is being ready for playing
my english isnt ok i couldnt explain what i think i hope you can understand
openup your heart and let the sun shine in
|
|
|
|
|
Hi,
I am new to .Net. I developed a web application in ASP.Net and C#. Here I included a reference to Acrobat COM dll. I actually want to remove the toolbars from the PDF Document. But when I try to run the application, it throws a runtime error "Access Denied". I tried to register the COM dll using:
"regsvr32 Interop.Acrobat.dll". But here the error message is that: "the dll was loaded but entry point was not found".
To deal with the error "Access denied", I included "<identity impersonate="True">" in the web.config file. This helps run the application only on the server. When I try to run the application form a client, it throws a "runtime error" or "Server eror".
Can anyone suggest me a solution. Either how to run the application on clients using identity impersonate="true" or a solution to the Acrobat COM object.
I am facing a tough time and any help would be really appreciated.
Thanks,
Awase.
|
|
|
|
|
Hi,
i have written following code
TextBox tb = new TextBox();
tb.Text = "ghjhgjh";
Label lbl = new Label();
lbl.Text = "Hello, World!";
lbl.Font.Bold = true;
Controls.Add(lbl);
Controls.Add(tb);
foreach (Control c in Controls)
Label1.Text += c.ToString() + " - " + c.ID + " ";
but on running i get the following exception --> Control 'ctl03' of type 'TextBox' must be placed inside a form tag with runat=server.
also please explain how to retain the view state of the text box.
|
|
|
|
|
On the HTML tab of the .aspx page you should see the <textbox> tags. Make sure that it is within the tags. I've had that happen before. Within the textbox you can do
<asp:textbox id="abc" runat="server" viewstateenabled="true/">
Hope that helps!
|
|
|
|
|
Hi,
adding within controls inside form tag is not under my control unless i use addat function.
Moreover pls help with retaining the view state .Many say that it should be added in the init ftion.But still doesnt work.Pls write a small snippet if possible because couldnt find a suitable link i require in net.
|
|
|
|
|
Go to the properties of the text box and make view state as true.
View state will be automatically saved.
Make sure That textbox is server control.
Go to html, make sure that is within tag and include runat = server
hope that helps
|
|
|
|
|
hi,
i have given this piece of code in page Load()
{ DDLSortBy=new DropDownList ();
DataSet ds=new DataSet ();
da.Fill(ds);
DDLSortBy.DataSource = ds.tables[0]
DDLSortBy.DataTextField = "EmpId";
DDLSortBy.DataValueField = "EmpId";
DDLSortBy.DataBind();
DDLSortBy.SelectedIndex = 0;
DDLSortBy .AutoPostBack = true;
DDLSortBy.SelectedIndexChanged += new System.EventHandler(DDLSortBy_SelectedIndexChanged);
plFrm.Controls.Add(DDLSortBy);
}
i am able to retain the value(view state) of the text box inspite of the DDL getting initialized each time on postback.I see no difference if initialize the controls on OnInit() function.
Then why many articles in net suggest us to dynamically add controls in init ftion() .
-- modified at 1:11 Wednesday 28th June, 2006
|
|
|
|
|
I think that it is because you add controls using Controls.add() on its own.
It may place the controls somewhere in the page that is not between form. Check that in the html generated through your browser.
Try using a placeholder where to add your controls and you will have no problems at all cycling through it getting controls infos.
|
|
|
|
|
hi all,
i have 4 radiobuttons on my page. i have set groupname properties of this buttons. now i want to get which radio button was selected. how can i do this?
openup your heart and let the sun shine in
-- modified at 21:26 Tuesday 27th June, 2006
|
|
|
|
|
|
+ Option 1: simply walk through the 4 radiobutton and do checking on the Checked property of each radiobutton.
+ Option 2: use the RadioButtonList control instead of seperate 4 controls, and the control supports a couple of properties SelectedXXX which can help you.
|
|
|
|
|
If it's a RadioButtonList you can use the SelectedItem property to find out which RadioButton is selected.
If you have 4 separate radio buttons you have to check them one by one to find out which one has radioButton.Checked = true;
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
thanks for your replies,
i have location problem so i cant use radio button list, i cant check checked properties of them because there are 8 groups = 32 radiobuttons so it could be very nice there is a way like radiobuttonlist selected item property
openup your heart and let the sun shine in
-- modified at 22:52 Tuesday 27th June, 2006
|
|
|
|
|
Hi,
I am plotting a dynamic/multiple web chart objects based on the data that i query from database.
below are my aspx code,
-----------------------
<asp:datalist id="dlScHead" runat="server" ShowFooter="False" ShowHeader="False" CellSpacing="0"
CellPadding="0" Width="100%">
<ItemTemplate>
<table style="FONT-SIZE: 0.8em; font-face: Arial" cellPadding="5" width="100%" align="center"
border="0">
<tr>
<td style="BORDER-RIGHT: #000000 2px solid; BORDER-TOP: #000000 2px solid; BORDER-LEFT: #000000 2px solid; BORDER-BOTTOM: #000000 2px solid"
colSpan="3"><b>
<%# ctype(DataBinder.Eval(Container.DataItem,"ScoreCardID"),string) %>
<%# ctype(DataBinder.Eval(Container.DataItem,"scorecarddesc"),string) %>
</b>
<br>
<%# ctype(DataBinder.Eval(Container.DataItem,"BusinessGoal"),string) %>
</td>
</tr>
</table>
<asp:datalist ID="dlScChart" Width="100%" DataSource='<%# (GetRecords(Cstr(DataBinder.Eval(Container.DataItem, "scoreCardId"))))%>' runat="server">
<ItemStyle VerticalAlign="Top" BackColor="#EEEEEE"></ItemStyle>
<ItemTemplate>
<table>
<tr valign="top">
<td>
<asp:PlaceHolder id="Placeholder1" runat="server"></asp:PlaceHolder>
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>
<table style="FONT-SIZE: 0.8em; font-face: Arial" cellPadding="5" width="100%" align="center"
border="0">
<tr>
<td colSpan="3">
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter1").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter2").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter3").tostring()) %>
<br>
<br>
<%# Server.htmlDecode(DataBinder.Eval(Container.DataItem,"Quarter4").tostring()) %>
<br>
<br>
</td>
</tr>
</table>
</ItemTemplate>
</asp:datalist>
-----------------------
vb code.
-----------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
objConn = New SqlConnection(dbPath)
Try
objConn.Open()
cmd = New SqlCommand("select * from bizProgram where bizProgId='" & Request.QueryString("bizProgId") & "'", objConn)
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
If dr.Read Then
lblImg.Text = "<img src='/shireplan/images/" & dr("bizProgImg") & "' ALIGN=CENTER BORDER=0 HSPACE=10 ALT='" & dr("bizProgImg") & "'>"
lblProgOutcome.Text = "<b>OUTCOME</b><br>" & dr("bizProgOutcome")
lblProgOper.Text = "<b>OPERATIONAL PROGRAM</b><br>" & dr("bizProgOperational")
lblProgId.Text = dr("bizProgId")
End If
Catch ex As Exception
Response.Write("OOPS.what went wrong:" + ex.ToString)
Finally
objConn.Close()
End Try
dlScHead.DataSource = GetRecords(Nothing)
dlScHead.DataBind()
End Sub
Function GetRecords(ByVal scID As String) As SqlDataReader
Dim bizProgName As String = Request.QueryString("bizProgId")
Dim CommandText As String
Try
objConn = New SqlConnection(dbPath)
objConn.Open()
If scID = Nothing Then
Dim da As New SqlDataAdapter
da.SelectCommand = New SqlCommand
da.SelectCommand.Connection = objConn
da.SelectCommand.CommandText = "select scorecardId,bizProgId,scorecarddesc,businessgoal,strategy,quarter1,quarter2,quarter3,quarter4 from textData where bizProgID='" & Request.QueryString("bizProgId") & "'"
dr = da.SelectCommand.ExecuteReader(CommandBehavior.CloseConnection)
If dr.HasRows Then
'lblError.Text = ""
Else
'lblError.Text = "No records returned"
End If
GetRecords = dr
Else
cmd = New SqlCommand("select distinct measure_id from measuredata where scoreCardId = '" & scID & "'", objConn)
Dim da As SqlDataAdapter = New SqlDataAdapter(cmd)
Dim dtId As New DataTable("MeasureId")
da.Fill(dtId)
'select all columns with ID
Dim cmd1 As SqlCommand = New SqlCommand("select period,actual, target, scorecardid, scorecard,measure_id, measure_desc from measureData where scoreCardId = '" & scID & "'", objConn)
Dim da1 As SqlDataAdapter = New SqlDataAdapter(cmd1)
Dim dt As New DataTable("MeasureSource")
da1.Fill(dt)
Dim datarow As DataRow
For Each datarow In dtId.Rows
Dim chart As New dotnetCHARTING.Chart
chart.Type = dotnetCHARTING.ChartType.Combo
chart.DefaultSeries.DefaultElement.Transparency = 35
chart.TempDirectory = "temp"
chart.ChartArea.XAxis.Label.Text = "Customers"
chart.Debug = True
chart.TempDirectory = "temp"
chart.Width = Unit.Parse(420)
chart.Height = Unit.Parse(300)
Dim myView As New DataView(dt)
myView.RowFilter = String.Format("Measure_Id='{0}'", datarow.Item("measure_Id"))
chart.Series.Name = "Item sales"
chart.Series.Data = myView
chart.SeriesCollection.Add()
Dim i As Integer
For i = 0 To dlScChart.Items.Count - 1
dlScChart.Items(i).FindControl("Placeholder1").Controls.Add(chart)
Next
Next datarow
End If
Catch ex As Exception
Response.Write("error on child" + ex.ToString)
Finally
End Try
End Function
-----------------------
In the above case, the web chart is drawn successfully for different measure ID if i put the placeholder object outside the dlScChart and do followings in vb code
-----------------------
For i = 0 To dlScHead.Items.Count - 1
dlScHead.Items(i).FindControl("Placeholder1").Controls.Add(chart)
Next
-----------------------
but the problem is the scoreCardID 1 is getting measure data for scoreCardId 2 so I am not getting correct webchart for scorecardIds.
can someone help me how it could be fixed so that i can get correct web charts for my scorecard ID.
thanks
|
|
|
|
|
Hi there,
There are a couple of things come to mind:
+ The GetRecords seems not to return the result in the else part.
+ The GetRecords is used to populate the data source for the dlScChart datalist control, so you should not put your code to build its child control (the charting control) in this method. In this case, you might consider using the ItemCreated/ItemDataBound event of the datalist control.
+ The ScoreCardID value contained in the datasource bound to the parent control dlScHead, so if you want to get this value from the child datalist dlScChart, you need to get reference to the DataListItem object of the parent datalist dlScHead. Another option is that you can populate the datasource bound to the child datalist control in a way that it should contain ScoreCardID value. And you can easily access this field when you build the charting control.
|
|
|
|
|
Hi there,
I'd be really grateful if you could please edit my code and show me as i am really having hard time. the next thing that i did was followed your way and now i am just getting able to populate charts with no data but every first measure_id is missing for each scorecard ID.
I did sumthing like this.
aspx
=====
<asp:repeater id="myRepeater" runat="server" OnItemDataBound="myRepeater_ItemDataBound">
<ItemTemplate>
<h3><%#DataBinder.Eval(Container.DataItem, "ScoreCardId")%></h3>
<br />
<asp:repeater id="NestedRepeater" runat="server">
<ItemTemplate>
<h4><%#DataBinder.Eval(Container.DataItem,"Measure_ID")%></h4>
<table><tr><td><asp:PlaceHolder ID="Placeholder1" Runat="server"></asp:PlaceHolder></td></tr></table>
</ItemTemplate>
</asp:repeater>
</ItemTemplate>
</asp:repeater>
===
vb
==
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
objConn = New SqlConnection(dbPath)
cmd = New SqlCommand("select Distinct(ScoreCardId) from measuredata;", objConn)
Dim sdap As New SqlDataAdapter(cmd)
Dim ds As New DataSet
sdap.Fill(ds)
myRepeater.DataSource = ds
myRepeater.DataBind()
End Sub
Public Sub myRepeater_ItemDataBound(ByVal sender As Object, ByVal e As RepeaterItemEventArgs)
Dim dv As DataRowView = e.Item.DataItem '
If Not (dv Is Nothing) Then
Dim nestedRepeater As Repeater = e.Item.FindControl("NestedRepeater") '
If Not (nestedRepeater Is Nothing) Then
objConn = New SqlConnection(dbPath)
Dim scorecardID As String = dv("ScoreCardId").ToString()
cmd = New SqlCommand("select distinct(Measure_ID) from measuredata where ScoreCardID='" & scorecardID & "'; select period,actual, target, scorecardid, scorecard,measure_id, measure_desc from measuredata where ScoreCardID='" & scorecardID & "'", objConn)
Dim subadap As New SqlDataAdapter(cmd)
Dim subDs As New DataSet
subadap.Fill(subDs)
nestedRepeater.DataSource = subDs
nestedRepeater.DataBind()
nestedRepeater.DataMember = subDs.Tables(0).TableName
'We need to specify the DataMember as the dataset has 2 tables.
Dim datarow As DataRow
For Each datarow In subDs.Tables(0).Rows
Dim chart As New dotnetCHARTING.Chart
chart.Type = dotnetCHARTING.ChartType.Combo
chart.DefaultSeries.DefaultElement.Transparency = 35
chart.TempDirectory = "temp"
chart.ChartArea.XAxis.Label.Text = "Customers"
chart.Debug = True
chart.TempDirectory = "temp"
chart.Width = Unit.Parse(420)
chart.Height = Unit.Parse(300)
Dim myView As New DataView(subDs.Tables(0))
myView.RowFilter = String.Format("Measure_ID='{0}'", datarow.Item("Measure_ID"))
chart.Series.Name = "Item sales"
chart.Series.Data = myView
chart.SeriesCollection.Add()
Dim i As Integer
For i = 0 To nestedRepeater.Items.Count - 1
nestedRepeater.Items(i).FindControl("Placeholder1").Controls.Add(chart)
Next
Next datarow
'nestedRepeater.DataBind()
End If
End If
End Sub 'myRepeater_ItemDataBou
====
please help
thanks
|
|
|
|
|
You need to specify the DataMember property before calling the DataBind method:
nestedRepeater.DataSource = subDs
nestedRepeater.DataMember = subDs.Tables(0).TableName
nestedRepeater.DataBind()
'nestedRepeater.DataMember = subDs.Tables(0).TableName
|
|
|
|
|
Hi,
yeah i did try that earlier but it skips every first measureid of a scorecardId dont know why.
|
|
|
|
|
uglyeyes wrote: For Each datarow In subDs.Tables(0).Rows
Dim chart As New dotnetCHARTING.Chart
chart.Type = dotnetCHARTING.ChartType.Combo
chart.DefaultSeries.DefaultElement.Transparency = 35
chart.TempDirectory = "temp"
chart.ChartArea.XAxis.Label.Text = "Customers"
chart.Debug = True
chart.TempDirectory = "temp"
chart.Width = Unit.Parse(420)
chart.Height = Unit.Parse(300)
Dim myView As New DataView(subDs.Tables(0))
myView.RowFilter = String.Format("Measure_ID='{0}'", datarow.Item("Measure_ID"))
chart.Series.Name = "Item sales"
chart.Series.Data = myView
chart.SeriesCollection.Add()
Dim i As Integer
For i = 0 To nestedRepeater.Items.Count - 1
nestedRepeater.Items(i).FindControl("Placeholder1").Controls.Add(chart)
Next
Next datarow
Having a look at this code, I can see that you are creating the chart control inside the fist for statement, but you are adding it to the Controls collection in the second for statement. It means, in the second loop you are using the same chart object to add to the Controls collection. However, there's one important thing that you may not know is that each control only has one parent control, it also means when you add a control to the Controls collection of the new parent control, it will remove the control out of the Controls collection of the current parent control. And as a result of that, the chart control only exists in the last RepeaterItem of the nestedRepeater.
So to work around this problem, you might consider creating the chart control in the second for statement, another option is to create a handler for the ItemDataBound event of the nestedRepeater.
|
|
|
|
|
hi all,
i have problem with javascript. i wrote a function, when i use
|
|
|
|
|
Looks like you are a bit confused between the client side event onclick with the server side event with the same name. If you are using the ASP.NET 2.0, you can check out the OnClientClick event of the button.
|
|
|
|
|
The error was caused by your compiler looking for startClock function in the code-behind file.
If your button is an ASP button, the OnClick is meant to call server-side function (ie. .Net functions). You should use the OnClientClick instead to call your javascript function.
"Democracy is two wolves and a sheep voting on what to have for dinner" - Ross
Edbert
Sydney, Australia
|
|
|
|
|
tanks for your replies,
i am confused because i am very new in asp.net applications . the point of i couldnt understand why this code runs body onload event but returns error on button click event . when i click the button i will start a client side timer and show this to user like a kronometer. also i have something to do on button click event . if i use input(http) button could i use javascript code and click event together?
my english isnt ok so i cant explain what i mean clearly . i hope you can understand
openup your heart and let the sun shine in
|
|
|
|