|
if (Request.QueryString["textbox"] != "")
{
string strScript = "window.opener.document.forms(0)." + Request.QueryString["textbox"].ToString() + ".value = '";
strScript += Calendar.SelectedDate.ToString("dd/MM/yyyy");
strScript += "';self.close()";
strScript += "</" + "script>";
RegisterClientScriptBlock("Calendar_ChangeDate", strScript);
}
|
|
|
|
|
Hi All,
I have some ASP.Net web pages that use C# as code behind. On those ASPX pages, there r some datagrids that I want to print.
I have seen help about printing datagrids on standalone applications but dont know how to do it on WebBased applications such as mine.
Any help/ideas/urls wud be greatly appreciated
Thanx
Umashanker.k
|
|
|
|
|
Try the below mentioned code:-
<script language=javascript>
function CallPrint(strid)
{
var prtContent = document.getElementById(strid);
var WinPrint = window.open('','','letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
WinPrint.document.write(prtContent.innerHTML);
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
prtContent.innerHTML=strOldOne;
}
</script>
<div id="divPrint">
<asp:datagrid>
.....
.....
.....
</asp:datagrid>
</div>
<asp:button ID="btnPrint" onClick="javascript:CallPrint('divPrint');" Runat=Server />
|
|
|
|
|
Hi, I am using a wizard control, and I notice that when it places the "next" button, it puts this in a table, then in a td with align=right specified as a style.
Now I want to remove this style. I thought the best way to do this is to override the control, however if i do that, I cannot find what the rendered html looks like to overwrite. Does anyone know how you can overwrite this before the control gets generated?
|
|
|
|
|
hello all l am student of computer engineer and l was given a project at that point l need help about problem that is l want to create a ftp user acount and l want to make relatoin between that user account and virtual directory for example;
l creat a user acount:
user name:jack
pasword:*****
let say our vitual directory directory is www.mst.edu
now question is what l want to learn is how can l illustrate that vitual directory with username ?
when l typed at the adressbar www.mst.edu/jack l want to see account of jack
please help me...l already thaks who keep knowledge exchange!
by the way l use asp.net 2005 whit framework 2.0 and please tell me how should l open new project in viual studio.net step by step for this problem
Engineerusa
|
|
|
|
|
Hi
I am after a bit of help, I have a paged datasource displayed in a repeater which is working fine for me. The number of rows returned is populated from a ddl and is either 10, 20 or 50. This works ace and is brill. However I want to have another option for all. In which case all the rows are returned and only one page is shown. I have currently got the pagesize set to 2000000 which is not exactly ideal is it? Would like it so that it will just show them all rather than restricting to a page size no matter how large a one that I pick. Is there any ideas?
Cheers
Ian
|
|
|
|
|
Why don't you just turn paging off. That should do it.
Ben
|
|
|
|
|
Good plan although I am not sure how I can do this using my code. I mean I know its possible but just having a mental block, been looking at it for ages now and all the words are jumbling into one!
I have a load data method which populates my repeater.
' This Method is responsible for reloading the data when a user event like a sort or <br />
' a filter is applied to the user control<br />
Private Sub LoadData(ByVal b As Boolean)<br />
'I need to load all my data into the repeater control.<br />
Dim strConnectionString As String = sqlViewCalls.ConnectionString<br />
<br />
Dim sqlConnection As SqlConnection = New SqlConnection(strConnectionString)<br />
sqlConnection.Open()<br />
<br />
Dim sqlDA As SqlDataAdapter<br />
sqlDA = New SqlDataAdapter(hidViewString.Value.ToString() & hidQueryString.Value.ToString() & hidSortString.Value.ToString(), sqlConnection)<br />
<br />
Dim dt As DataTable<br />
dt = New DataTable()<br />
sqlDA.Fill(dt)<br />
sqlConnection.Close()<br />
<br />
' Create a new PagedDataSource<br />
Dim pgItems As PagedDataSource<br />
pgItems = New PagedDataSource()<br />
<br />
' Create a new DataView from the datatable we created before.<br />
Dim dv As DataView = New DataView(dt)<br />
' Initialise the PagedDataSource and populate it.<br />
pgItems.DataSource = dv<br />
pgItems.AllowPaging = True<br />
pgItems.PageSize = pgSize<br />
pgItems.CurrentPageIndex = PageNumber<br />
<br />
If b = True Then<br />
If pgItems.PageCount > 1 Then<br />
Dim pages As ArrayList = New ArrayList()<br />
For index As Integer = 0 To (pgItems.PageCount() - 1)<br />
pages.Add((index + 1).ToString())<br />
Next<br />
hidLast.Value = (pages.Count() - 1).ToString()<br />
Else<br />
hidLast.Value = 0<br />
End If<br />
End If<br />
<br />
lblPagination.Text = " Page: " & (pgItems.CurrentPageIndex + 1).ToString() & " of " & pgItems.PageCount & " (" & pgItems.DataSourceCount & " Records)"<br />
<br />
repResults.DataSource = pgItems<br />
repResults.DataBind()<br />
<br />
End Sub
Then in the selection Changed of the ddl (which is populated by 4 values, 10,20,50 and all) I have
<br />
Protected Sub ddlPageSize_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlPageSize.SelectedIndexChanged<br />
If ddlPageSize.SelectedIndex = 3 Then<br />
pgSize = 2000000<br />
PageNumber = 0<br />
LoadData(True)<br />
' Code to enable buttons/disable buttons here<br />
Else<br />
pgSize = Integer.Parse(ddlPageSize.SelectedValue)<br />
PageNumber = 0<br />
LoadData(True)<br />
' Code to enable buttons/disable buttons here<br />
End If<br />
End Sub<br />
I commented out the paging buttons disabling/renabling but you get the idea. Anyhelp would be appreciated.
Cheers
Ian
|
|
|
|
|
In your load event I would check the dropdown index
So add some code like:
pgItems.DataSource = dv
If ddlPageSize.SelectedIndex = 3 Then
pgItems.AllowPaging = False
Else
pgItems.AllowPaging = True
pgItems.PageSize = pgSize
End If
When the dropdown event happens the pageload method is called again.
Hope that helps.
Ben
|
|
|
|
|
Thanks for your help,
That works great and is so obvious I can't believe I didn't think of it myself. Sometimes you can't see the wood for the trees can you? lol
Cheers
Ian
|
|
|
|
|
Glad it worked for you. Sometimes it just helps to bounce a question off someone else.
Ben
|
|
|
|
|
Hello!
We use IIS, ASP.NET 2.0. I added AJAX calendar to pages.
Everything was allright on localhost, but when we load new version on server it does not work.
But if we move project to the default directory wwwroot, evething is allright
Thank you.
Error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
|
|
|
|
|
You are most likely an admin on your local box. At least one of the functions your site is trying to do is requiring permission more then then aspnet user currently has.
So you have a couple of options. First you can give aspnet User on that web server the rights it needs. This is normally not a great idea since it can be a security risk.
You can set up a new app pool for the web site to run under and then create a new user for the app pools identity. Then you can give that user all the rights they need.
Hope that helps.
Ben
|
|
|
|
|
Hi, Ben, thank you for your help
Unfortunatly we try to create an app pool and user, but in that case we've got an error
Service Unavailable
I don't know what that mean.
Another action: we create app pool and set user IWAM_ blah blah
then we got an error failed to create smt in C:\WINDOWS\temp.....
Thank you
|
|
|
|
|
If you get service unavaiable there is a pretty good chance you forgot to add your new user to the IIS_wpg group on the server. I probably forgot to mention that. I would not suggest using the IWam_... user. Once you have give rights to your new user and the iis_wpg group you should be good to go.
Hope that helps.
Ben
|
|
|
|
|
Hi,
I'm working on a project for dynamic code generation. We are creating the entire solution from scratch here(just at the initial stage).
I create aspx and code behind files in the PL, but after the entire solution is created, I try to open the aspx file in the designer and I get this error:
"The file could not be loaded in to the Web Forms designer."
I am getting this link for help:
http://msdn2.microsoft.com/en-us/library/aa289356(VS.71).aspx
But I'm using src attribute like this and it was working when creating file using VS 2003:
<script src="../JS/calendar.js" type="text/javascript"></script>
Could someone point out whats going wrong here.
Regards,
Blumen
-- modified at 0:20 Wednesday 30th May, 2007
|
|
|
|
|
hi.
I want to show the text of a lable in marquee mode ...
I mean the text should cross over and repeats ...
what should I do ?
I tried codding like this :
<MARQUEE id="MARQUEE1" dir="rtl" style="Z-INDEX: 101; LEFT: 576px; WIDTH: 320px; POSITION: absolute; TOP: 128px; HEIGHT: 64px"<br />
bgColor="#cccccc" runat="server"><asp:label id="Label1" style="Z-INDEX: 101; LEFT: 112px; POSITION: absolute; TOP: 16px" runat="server"Width="96px" Height="16px">hi</asp:label></MARQUEE>
but it just shows the text but not moving whats the problem?
I had read about innethtml ...but what is it?how shoudl I use it?
If I use a datagrid,and want to show the datagrid's content in a marquee,what should I do ?
-- modified at 10:57 Tuesday 29th May, 2007
|
|
|
|
|
I'd say read a book on graphic design
marquee is a non standard tag, what browser are you using ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
interner exlorer 7
my problem about moving lable has been solved.but tell me about datagrid to move with marquee
|
|
|
|
|
Hi All,
I want to show the text file(MS-Word file) into a Label control of ASP.NET in the same format as it is in the file
For example:
I have Word file hold the contents as given below
• Live telecast of international and national events on Aastha and Aastha International channels.
• High quality recording of Yoga guru Swami Ramdev’s sessions.
• Recording of discourses by gurus such as Acharya Brahmrishi Kirit Bhaiji, Acharya Mridul Krishna Shastri, Didi Ma Ritambhara, Swami Avdheshanand, Anandmurti Guru Ma and others for various TV channels.
• Recording of performances by singing sensations Anuradha Paudwal, Narendra Chanchal, Lakhvinder Sigh Lakha, Vinod Agarwal, Nandu Bhaiya and Piyusha and Kailash Anuj, to name a few.
I want to display these points given above in a Label
So plz help me out
|
|
|
|
|
It would be easier to maintain the formatting by just showing the Word Document itself. You can create a user control for this and place it where the label is.
only two letters away from being an asset
|
|
|
|
|
Dear All,
i am making web application using asp.net, C# ,sql2005 using visual studio 2005
i am trying to use membership feature of asp.net2.0 and i did manage aomewhat.
Now i can create user through Createuserwizard But i want after user creates his profile. he need to authorized or activated by administrator
then only will be able to login. Is it possible ?
how to do it
please give me some useful link
Please help
thanks
regards
imran khan
|
|
|
|
|
Hi all
actually on my webpage am displaying some data on the datagrid row wise...as per the project requirement am exposing the data to be editable(displaying in the text boxex) by making use of the itemtempale ...and am keeping one button outside the datagird.and while cliking on the button i am updating the entire datagrid by accepting what ever the data is modified
i.e by calling like
foreach(DataGridItem itm in DataGrid1.Items)
{
string st,st1,st2;
st=((Label)itm.Cells[0].FindControl("lblAccountId")).Text;
st1=((TextBox)itm.Cells[1].FindControl("AccCode")).Text;
st2=((TextBox)itm.Cells[2].FindControl("Descrip")).Text;
dataAdapter=new SqlDataAdapter("update AccountCode set AccountCode='" + st1 + "',Description='" + st2 + "'where AccountId=" + st,con);
dataAdapter.Fill(ds,"contentTable");
}
Know what the problem is...there was somany records like (100+ in the database)..if i did like this,it took a database interaction
to update each row ...i.e,for the single click it will take 100+ times of database interaction...
bcz of performance resion i want to avoid these interactions...i want the updation to be done by making single interaction with the database(i.e i want to handle all the datagrid data and take the updation at single time)......Plz help me out ,,or let me have some articles related to this....
regards
yuva
|
|
|
|
|
|
Gday everyone,
I have a new problem that I need some help
I have a horizontal menu using SiteMapDataSource. I need to put a separator or an image between menu items, I looked at menu control property, but it seems there is no such property to select.
Please guide me.
Thanks in advance
eric
|
|
|
|