|
Hi,
You can use javascript window.open function to open a popup window.
Best Regards,
Apurva Kaushal
|
|
|
|
|
check out this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<script language="javascript" type="text/javascript">
<!--
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes';
win=window.open(mypage,myname,settings);}
// -->
</script>
I invoke my pop up window as follows:
<a href="Name of a aspx application.aspx" tabindex=-1 onclick="NewWindow(this.href,'Name of aspx','800','550','yes','center');return false" onfocus="this.blur()"> href display name </a>
Murtaza Tahir Ali Dhari
-- modified at 6:53 Thursday 15th June, 2006
|
|
|
|
|
http://javascriptkit.com/popwin/index.shtml
Use this link u will get the code.
|
|
|
|
|
Am using this statement to authenticate users
"Call lo_IADs.OpenDSObject("WinNT://" & domain, user, pwd, 1)"
sometimes i get the error
"Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again"
only a server restart brings it back to normal
could anybody clarify what is happening, and is there a problem if users goes beyond 500.
thanks in advance
|
|
|
|
|
HI,
I have a window's applicaiton in which I have a tree view consistng of certain values. Now when I right click on the node I should be in a position to edit the text there itself. Similar to the windows explorer where we have a names of the files in the directories where we can right click on the file/directory and change the name.I mean I want to implemnt the rename feature on my tree view node.I am using .net framework 1.1
I tried using the labeledit property but it s not working.
Regards
Uma
|
|
|
|
|
Hi
Does anybody know how to use OracleDataAdapter with OracleTransaction ?
My problem is that even if I use OracleTransaction.Rollback() method the OracleDataAdapter.Update method is executed and results are in database.
here is the example (create WebForm1 with button (id=BUTTON1) and paste this code into VB file of the form
'---------------------------------------------------------------------------------
Imports System.Data.OracleClient
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Dim ORAcon As System.Data.OracleClient.OracleConnection
Dim ORAtrans As OracleTransaction
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
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'---------------------------------------------------------------------------------
Dim lc_tabname As String = "table_test"
Dim conStringORA As String = "here is the connection string"
Me.ORAcon = New System.Data.OracleClient.OracleConnection(conStringORA)
Me.ORAcon.Open()
Me.ORAtrans = Me.ORAcon.BeginTransaction(IsolationLevel.ReadCommitted)
Dim lc_sql As String = lc_sql = "select * from " & lc_tabname & " where ID=0"
'this select statement return no row
Dim objDataAdapter As New OracleDataAdapter(lc_sql, Me.ORAcon)
Dim objDataSet = New DataSet
objDataAdapter.Fill(objDataSet, lc_tabname)
Dim newrow As DataRow
newrow = objDataSet.tables(lc_tabname).newrow()
newrow("test_string") = "abc"
objDataSet.tables(lc_tabname).rows.add(newrow)
Dim caa As New OracleCommandBuilder(objDataAdapter)
objDataAdapter.Update(objDataSet, lc_tabname)
Me.ORAtrans.Rollback()
Me.ORAcon.Close()
'---------------------------------------------------------------------------------
End Sub
End Class
'---------------------------------------------------------------------------------
Better any help, than no help ...
Jerry
|
|
|
|
|
Hi all,
I am using paging in datagrid and implemented paging successfully.
In my application I have checkbox and Id field in datagrid,On button click I want to save Ids which having checkbox status checked.
I implement solution thats is working correctly if datagrid having single page.But if I checked checkboxes from different pages in datagrid only last page Ids get saved.
I mean In paging if i want to save entries of two pages i could not do that.
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
If chk.Checked = True Then
lbl = DirectCast(gridItem.FindControl("ID"), Label)
'''''Saving code here
end if
next
|
|
|
|
|
You can save the checkbox ids in a viewstate and get it later while submitting.Otherwise use datagrid without paging.
|
|
|
|
|
Hi,
my checkbox is not binding to ant datafield.I am using viewstate to maintain Ids whose checkbox are checked but when loop
For Each gridItem In DataGrid1.Items
next
executes that consider datagrid items count=Item present on current page and not total datagrid item present on all pages.
I give some code for understanding
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Fillgrid()
End If
Maintain_View()
Retrieve_Viewstate()
End Sub
Private Function Maintain_View()
Dim recordArray(DataGrid1.Items.Count - 1) As String
Dim n As Integer
Dim gridItem As DataGridItem
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
If chk.Checked Then
recordArray(n) = lbl.Text
n += 1
End If
Next
ViewState("recordArray") = recordArray
End Function
Private Function Retrieve_Viewstate()
Dim recordArray(DataGrid1.Items.Count - 1) As String
Dim n As Integer
Dim gridItem As DataGridItem
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
recordArray = ViewState("recordArray")
For n = 0 To DataGrid1.Items.Count - 1
If recordArray(n) = lbl.Text Then
chk.Checked = True
End If
Next
Next
End Function
I hope you help me...
|
|
|
|
|
I think I am late to answer you.Have you solved this?
Otherwise
Don't maintain viewstate for each page.
in not postback, initialize the viewstate (i.e clear it)
1.you have checked something in first page (2 check boxes)
2.Now you are moving to other, at that time save the checkbox's ids in viewstate. (viewstate has 2 values).
3.you have checked something in second page (3 check boxes)
4.You are moving to the third page, get the array from already existing view state and append second page's checkbox ids. (Now viewstate has 2+3 values)
5.while submitting , get it from viewstate and clear it.
6.Incase if you come to previous page,check with viewstate and populate the check boxed accordingly, if there is any change, change the viewstate value.
Hope it will help you.
|
|
|
|
|
Hi,
As you suggest I tried to use viewstate.But broblem is that for...loop
( For Each gridItem In DataGrid1.Items) is taking item count equals to items present in current page and not total item s in datagrid.So I can not retrive my first page values which are stored in viewstate.
I am sending changed code.Please have look at it.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
fillgrid()
End If
Maintain_View()
Retrieve_Viewstate()
end sub
Private Function Maintain_View()
Dim recordArray(DataGrid1.Items.Count - 1) As String
Dim n As Integer
Dim gridItem As DataGridItem
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
If chk.Checked Then
recordArray(n) = lbl.Text
ViewState.Add(lbl.Text, lbl.Text)
n += 1
End If
Next
End Function
Private Function Retrieve_Viewstate()
Dim recordArray(DataGrid1.Items.Count - 1) As String
Dim n As Integer
Dim gridItem As DataGridItem
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
recordArray = ViewState("recordArray")
For n = 0 To DataGrid1.Items.Count - 1
If ViewState.Item(n) = lbl.Text Then
chk.Checked = True
End If
Next
Next
End Function
|
|
|
|
|
Like this you can implement it on vb.net .
I jave given a rough code to do
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
if(!IsPostBack)
{
Fillgrid();
//Initialize view state
ViewState["ID"]=null;
}
}
private void Fillgrid()
{
//To fill the grid
}
private void Maintain_View()
{
ArrayList ar=new ArrayList();
//Get Array List from Viewstate
if(ViewState["ID"]!=null)
ar=(ArrayList)ViewState["ID"];
//Check for items in the datagrid and accoring to the checkbox value
//add it to arraylist
foreach (DataGridItem dt in dgItems.Items)
{
//If check box valuw is checked
{
ar.Add(checkId); //Add to arrayList
}
}
//Set it to viewstate
ViewState["ID"]=ar;
}
private void Retrieve_View()
{
ArrayList ar=new ArrayList();
//Get Array List from Viewstate
if(ViewState["ID"]!=null)
ar=(ArrayList)ViewState["ID"];
//Compare this with datagrid items and populate the checkboxes
}
private void dgItems_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
{
//while in pagination
dgItems.CurrentPageIndex =e.NewPageIndex();
Maintain_View();
Retrieve_View();
Fillgrid();
}
|
|
|
|
|
Hi Suamal,
Sorry For trouble.
As you suggest I make changes in my code.
Viewstate maintain Selected id list,But Loop count(For Each gridItem In DataGrid1.Items) is for current page only that means if i select 2 entries out of 5 from first page then 2 entries saved in viewstate,next i move to next page and select 3 items from second page Retrieve_Viewstate1's code
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
If Arr.Contains(lbl.Text) Then
chk.Checked = True
End If
Next
execute for selected 3 items from current page only.
I mean For Each gridItem In DataGrid1.Items...next loop is consider for current page item count instead of total number of items in datagrid
Is it correct loop or you are saying to use datagridview.
I hope you keep continue to answer.
I am sending latest code as below.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
fillgrid()
ViewState("ID") = System.DBNull.Value
End If
End Sub
Private Function Retrieve_Viewstate1()
Dim Arr As New ArrayList()
Dim n As Integer
Dim gridItem As DataGridItem
If Not (ViewState("ID") Is System.DBNull.Value) Then
Arr = CType(ViewState("ID"), ArrayList)
End If
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
If Arr.Contains(lbl.Text) Then
chk.Checked = True
End If
Next
End Function
Private Function Maintain_View1()
Dim Arr As New ArrayList()
Dim gridItem As DataGridItem
If Not (ViewState("ID") Is System.DBNull.Value) Then
Arr = CType(ViewState("ID"), ArrayList)
End If
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
If chk.Checked Then
Arr.Add(lbl.Text)
End If
Next
ViewState("ID") = Arr
End Function
Sub Pageing_Routine(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
Maintain_View1()
Retrieve_Viewstate1()
Fillgrid()
End Sub
|
|
|
|
|
Loop count of datagrid displays only the current page item count.
But in view state we can store all.
I will explain you how?
#Fill grid method()
1.Populate the grid (say 100 rows with 1 to 100 as ids)
clear viewstate
2.in first page select 2 checkboxes
3.In paging (to 2nd page)
add 2 ids to viewstate.
now it has 1,2.
while retriving
check for 1,2 ids in grid it will not be there.
4.In second page u select 3
add 3 ids with existing viewstate
now it has 1,2,11,12,13
while retriving
check for 1,2,11,12,13 ids in grid it will not be there.
5.goto 3rd page ,without selecting any ids.
now viewstate has 1,2,11,12,13
6.Return to 2nd page
now while retriving
check for 1,2,11,12,13 ids in grid 11,12,13 ids will be there.
If you change anything, you have to alter the viewstate.
# in maintain view
Private Function Maintain_View1()
Dim Arr As New ArrayList()
Dim gridItem As DataGridItem
If Not (ViewState("ID") Is System.DBNull.Value) Then
Arr = CType(ViewState("ID"), ArrayList)
End If
For Each gridItem In DataGrid1.Items
Dim chk As CheckBox = DirectCast(gridItem.FindControl("Status"), CheckBox)
Dim lbl As Label = DirectCast(gridItem.FindControl("ID"), Label)
//If already exists then, remove it from the list
If Arr.Contains(lbl.Text) Then
Arr.Remove();
End If
If chk.Checked Then
Arr.Add(lbl.Text)
End If
Next
ViewState("ID") = Arr
End Function
#call retrive view after fill GRid method
Sub Pageing_Routine(ByVal s As Object, ByVal e As DataGridPageChangedEventArgs)
DataGrid1.CurrentPageIndex = e.NewPageIndex
Maintain_View1()
Fillgrid()
Retrieve_Viewstate1()
End Sub
|
|
|
|
|
Great!!!!!!!
You are Genius!!!!!!!
I don't have words to say thanks to you.I really Grateful to you.
I hope we will meet soon with some more..........
Best Regards,
Nagraj
Teach Life To Laugh........
|
|
|
|
|
Hi
i have developed a webpage which contains a required field validator when i try to save information on this page by clicking save button.
i get following javascript runtime error:
" Page_Validators is undefined "
but when i see the html code of it by right click and then clicking viewsource
it displays that there is a validator present
I don't understand why this problem occurs and unable to trace it.
Can somebody throw some light on this error.
Any help will be greatly appreciated.
Praveen
-- modified at 3:35 Thursday 15th June, 2006
|
|
|
|
|
Which version of the ASP.NET are you using? What does your web page look like? Do you want to validate the input controls when the Save button is clicked? You might want to post some of the ASP.NET markups in the web page.
|
|
|
|
|
Hi I am in process of this task. i am not worrying about chart i am working about organising my data first to bind to a chart.
i dont get any data in the last repeater. my aspx code
===========================
<asp:repeater id="myRepeater" runat="server">
<ItemTemplate>
<TR>
<TD><b><u><%#DataBinder.Eval(Container.DataItem, "ScoreCardId")%></u></b></TD>
</TR>
<asp:repeater id="NestedRepeater" runat="server">
<ItemTemplate>
<TR>
<TD><%#DataBinder.Eval(Container.DataItem,"Measure_ID")%>
<br>
</TD>
</TR>
<asp:Repeater id="SubNestedRepeater" Runat="server">
<ItemTemplate>
<tr>
<td><%#DataBinder.Eval(Container.DataItem,"period")%></td>
<td><%#DataBinder.Eval(Container.DataItem,"target")%></td>
<td><%#DataBinder.Eval(Container.DataItem,"actual")%></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:repeater>
</ItemTemplate>
</asp:repeater>
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)
cmd = New SqlCommand("select distinct(ScoreCardId) from measuredata;select * from measuredata", objConn)
Dim sdap As New SqlDataAdapter(cmd)
Dim ds As New DataSet
sdap.Fill(ds)
ds.Relations.Add(New DataRelation("NestThem", ds.Tables(0).Columns("ScorecardId"), ds.Tables(1).Columns("ScorecardId")))
myRepeater.DataSource = ds
myRepeater.DataBind()
End Sub
Private Sub myRepeater_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles myRepeater.ItemDataBound
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)
cmd = New SqlCommand("select distinct (measure_id) from measuredata; select * from measuredata", objConn)
Dim subadap As New SqlDataAdapter(cmd)
Dim subDs As New DataSet
subadap.Fill(subDs)
subDs.Relations.Add(New DataRelation("NestThemSub", subDs.Tables(0).Columns("Measure_ID"), subDs.Tables(1).Columns("Measure_ID")))
nestedRepeater.DataSource = dv.CreateChildView("NestThem")
nestedRepeater.DataBind()
End If
End If
End Sub 'myRepeater_ItemDataBound
Private Sub nestedRepeater_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles nestedRepeater.ItemDataBound
Dim dv As DataRowView = e.Item.DataItem
If Not (dv Is Nothing) Then
Dim subNestedRepeater As Repeater = e.Item.FindControl("SubNestedRepeater")
If Not (subNestedRepeater Is Nothing) Then
subNestedRepeater.DataSource = dv.CreateChildView("NestThemSub")
subNestedRepeater.DataBind()
End If
End If
End Sub
------------------------------
I dont know why my subNestedReapeater is not getting any data.
please help.
EVENTUALLY I NEED TO BE ABLE TO DISPLAY
ScorecardId
dynamic webchart objectS instead of subNestedRepeater
currently my output is something like this for the above code.
----------------
1
1.1.1.1
1.1.1.1
1.1.1.1
1.1.1.1
1.1.1.1
1.1.1.1
1.1.1.2
1.1.1.2
1.1.1.2
1.1.1.2
1.1.1.2
1.1.1.2
1.1.1.2
1.1.1.2
2
1.1.2.1
1.1.2.1
1.1.2.1
1.1.2.1
1.1.2.1
1.1.2.1
----------------
i want to display
1
webchart1 with all the data associated with measure_id 1.1.1.1
webchart2 with all the data associated with measure_id 1.1.2.1
2
webchart1 with all the data associated with measure_id 1.1.2.1 (only)
(please note since 2 have only one measure id so i need to plot only 1 webchart. the idea is i need to generate webchart dynamically based on how many measure_id there is for each ScorecardID.
|
|
|
|
|
fdgdfhfghfghf
suresh babu.k
|
|
|
|
|
What is this?
Best Regards,
Apurva Kaushal
|
|
|
|
|
It's an asdf with incorrectly positioned fingers.
---
b { font-weight: normal; }
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
Sir,
Can I rename the file programically in vb.net? If yes Please help me
Thanks and Regards
Amaneet Brar
|
|
|
|
|
|
dear all
can we draw graphs using asp.net/c#.net?
please reply
najeed
|
|
|
|
|