|
If a user with name admin and he is assign as the roles manager.if we login as admin how we set permission to create another user and allow acces to some pages in a project.please send the source code for setting permission to that rolemanager to create new user and allow permission to access the pages
|
|
|
|
|
|
hi,
I have a datagrid that loads data from sql server.
The datagrid is having in main page of the web site.
The problem is each time i refresh the main page, it took at least 10sec or more to load the datagrid due to lack of performance from the server.
Is there any way i can show a loading screen for datagrid so that customer can view the main page 1st??
Please help.....Thx....
|
|
|
|
|
Use UpdateProgress control of AJAX
bEst rEgard
pAthan
|
|
|
|
|
VinothRao wrote: The problem is each time i refresh the main page, it took at least 10sec or more to load the datagrid due to lack of performance from the server.
10 sec ? Is it a long time ? I don't think so. If you are using MSAjax library, you can use a UpdateProgress control which will show update progress. But for using this your Datagrid should be in an UpdatePanel .
You have to optimize your query to get good performance. Usually DataGrid/GridView loads entire records to the grid even though you enabled paging. So if you are displaying large number of data with these controls, use custom paging. This can improve the performance.
|
|
|
|
|
actually 10 sec is less, but problem is the db server is slow due to super high traffic.....
so sometimes it goes 10s, 20s or even close to 1 min......
this will make the page so slow in loading becoz of datagrid....
i'm so new to ajax......any sample guidance????
|
|
|
|
|
Hi all,
I have been facing a problem for a long time and i am not able to get any flick.
The scenario:
I am running a webservice for entering the data into the my database on a regular interval from a different source.
The solution:
I am using threading model for the same. The threads (4 in no) keeps their job going seperately and then each one of them sleep inside a infinite loop for a predefined period to enter the data again. Even if there is any error i catch it and then start again, like i said the things in seperate threads are in infinite loop.
Consequence:
The service works perfectly fine but then the application stops. I have entered a code at the application stop event in Global.asax which i receive at any time. Sometimes the service runs through hours while at other times it stops at any time like 10 mins, 5 mins....
Problem:
Now i am not able find any appropriate cause of the problem. Why the application is behaving this was why is it stoping when i want that to run for the lifetime?
Any help ....!!!
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
Hi all,
I've been trying to display binary data from a database and for the most part I was successful. I have found tutorials on how to display images but, it seems there are not too many tutorials out there on displaying such things as word docs. I've been trying for a very long time now and it seems I'm getting nowhere. The two things I am most interested in regarding Binary Data are how to display them and pagination. I've bought and borrowed books for these purposes but they only touched on the subjects a little bit. I'm using ASP.NET 1.1 so many of the ASP.NET 2.0 tutorials out there are at this point of no use to me. If you know of a site that talks about what I'm looking for, please point me to it. Thanking in advance for your help.
|
|
|
|
|
Sorry pal as far as doc type is all you required from the data base, i have no clue haven't thought of before.
I think you should have tried the way the image is being displayed but that's image source mmmm.....
....will think over and tell you if there is anything.
Do not forget to tune the Performance
Sudhir Yadav
|
|
|
|
|
What I've been trying to do is create a web app where users can submit their resumes, stories, etc. Then these files will be saved as binary data and stored in a database. They will be displayed when someone wants to see their contents. If there is a better way of doing that than saving them as binary data, I would like to hear about it. Thank you all for responding.
|
|
|
|
|
ASPnoob wrote: If there is a better way of doing that than saving them as binary data, I would like to hear about it. Thank you all for responding.
You can store the files in your server disk and keep the file path in database. But since you need to secure those files, it's better to keep them on database and binary.
Retrieving files from database and showing don't have any difference between showing images. First you need to set the content type to doc. Then use BinaryWrite(yourByteArray) . See the below code, assume you have taken the file in a byte array say 'b'
Response.ContentType = "application/doc";
Response.BinaryWrite(b);
Hope it helps
|
|
|
|
|
Why do you want to store doc file in the database?
I thing it is not a good idea to store doc file or any other file in the database.You can also put it in the folder.Create one folder and put all files in that folder with the userId and that file extention.You can easily read or download that file from the folder and just store that file name in the database
bEst rEgard
pAthan
please don't forget to vote on the post that helped you.
|
|
|
|
|
Imran Khan Pathan wrote: I thing it is not a good idea to store doc file or any other file in the database.
Why, ?
|
|
|
|
|
I need to display an operation successful/unsuccessful message client-side, after server-side code determines if the operation was successful or not.. I know how to display javascript alerts on button clicks, but I need an alert determined by server code.. help meee thanks. (Ps. I'm coding in C#)
|
|
|
|
|
On you event code, on completion, register the javascript with the ScriptManager. This can only be done during a postback, as the server can't push data to the client.
<br />
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "myuniquekey", @"alert('operation is complete');", true);<br />
"More functions should disregard input values and just return 12. It would make life easier." - comment posted on WTF
"This time yesterday, I still had 24 hours to meet the deadline I've just missed today."
|
|
|
|
|
u can msgbox concept for server side.
see this link:
http://www.bassilsoft.com/
|
|
|
|
|
I want sample code in asp.net 2003 with vb.net to dynamically(randomly) changing images with a given time interval?
|
|
|
|
|
Don't double-post. Read the forum guidelines.
Paul Marfleet
|
|
|
|
|
I've got a custom asp.net 2 login authentication creating a generic principal object and working great except that I can't get the logout to truly abandon/clear. For most of the site, I'm using one master page, but for the secure area, I'm using another master page. The secure master page uses menus, with the logout being a menu item redirect to another page (login.aspx?id=logout) with request parameters to fire. When I click logout, it does indeed take me back to the login page. But, if I manually type in the page where I've just been, it lets me through without a login. I've tried researching the problem and implementing suggestions to others, but nothing has worked. Any help GREATLY appreciated.
webConfig:
<authorization><allow users="*">
<trust level="Full" originurl=""><authentication mode="Forms">
<forms loginurl="calendar/login.aspx" protection="All" timeout="60" name=".myCookie" path="calendar/" requiressl="false" slidingexpiration="true" defaulturl="calendar/default.aspx" cookieless="UseDeviceProfile" enablecrossappredirects="false">
global.asax
Sub Application_AuthenticateRequest(ByVal sender As Object, ByVal e As EventArgs)
If HttpContext.Current.User IsNot Nothing Then
If HttpContext.Current.User.Identity.IsAuthenticated Then
If TypeOf HttpContext.Current.User.Identity Is FormsIdentity Then
' Get Forms Identity From Current User
Dim id As FormsIdentity = DirectCast(HttpContext.Current.User.Identity, FormsIdentity)
' Get Forms Ticket From Identity object
Dim ticket As FormsAuthenticationTicket = id.Ticket
' userdata string was retrieved from stored user-data
Dim userData As String = ticket.UserData
Dim roles As String() = userData.Split(","c)
' Create a new Generic Principal Instance and assign to Current User
System.Web.HttpContext.Current.User = New System.Security.Principal.GenericPrincipal(id, roles)
End If
End If
Else
System.Web.HttpContext.Current.User = Nothing
End If
End Sub
login.aspx
Function myAuth(ByVal mySql As String) As Boolean
'Response.Write(mySql)
FormsAuthentication.Initialize() ' Initialize FormsAuthentication
' Create connection and command objects , contactRole
Dim strConn As String = ConfigurationManager.ConnectionStrings("strConn").ConnectionString
Dim cn As New Data.SqlClient.SqlConnection(strConn)
Dim cmd As Data.SqlClient.SqlCommand
cmd = New Data.SqlClient.SqlCommand(mySql, cn)
cmd.Connection.Open()
Dim reader As Data.SqlClient.SqlDataReader = cmd.ExecuteReader()
Dim returnUrl As String, myReset As Boolean = False
If reader.Read() Then
Dim ticket As New FormsAuthenticationTicket(1, reader(0).ToString, DateTime.Now, DateTime.Now.AddMinutes(30), False, reader.GetString(1), FormsAuthentication.FormsCookiePath)
Dim hash As String = FormsAuthentication.Encrypt(ticket)
Dim cookie As New HttpCookie(FormsAuthentication.FormsCookieName, hash)
cookie.Expires = ticket.Expiration
Response.Cookies.Add(cookie)
lblPid.Text = reader(0).ToString
System.Web.HttpContext.Current.Session("UserNbr") = reader(0).ToString
returnUrl = Request.QueryString("ReturnUrl")
myReset = reader(2)
If myReset = True Then returnUrl = "~/secure/myAccount.aspx?upd=3&em=" & lblPid.Text
If returnUrl Is Nothing Then
returnUrl = "/calendar/secure/myAccount.aspx"
End If
' Don't call the FormsAuthentication.RedirectFromLoginPage here, it could replace the custom authentication
Response.Redirect(returnUrl)
Else
lblPid.Text = "0"
System.Web.HttpContext.Current.Session("UserNbr") = "0"
Response.Cookies.Clear()
System.Web.Security.FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear()
End If
reader.Close()
cn.Close()
cmd.Dispose()
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache)
If Not Page.IsPostBack Then
If Request("id") = "logout" Then
lblPid.Text = "0"
System.Web.HttpContext.Current.Session("UserNbr") = "0"
Response.Cookies.Clear()
Response.Clear()
System.Web.Security.FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear()
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)
txtUsername.Focus()
Else
If System.Web.HttpContext.Current.User Is Nothing Then
System.Web.HttpContext.Current.Session("UserNbr") = "0"
Response.Cookies.Clear()
Response.Clear()
System.Web.Security.FormsAuthentication.SignOut()
Session.Abandon()
Session.Clear()
txtUsername.Focus()
Else
Dim returnUrl As String = String.Empty
returnUrl = Request.QueryString("ReturnUrl")
If returnUrl Is Nothing Then
returnUrl = "~/calendar/secure/myAccount.aspx"
End If
End If
End If
End If
End Sub
secure master page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)
End Sub
individual secure area page:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now)
End Sub
|
|
|
|
|
Hi,
Can anyone provide me the regular Expression for validating the Person Names. That expression need to handle all types of names in the best way. The name contain alphanumerics and some special characters like _ , . .I don’t know exactly about any other type of special characters in names.
Thnaks
|
|
|
|
|
Go download a tool called Expresso. It will help you create RegEx expressions. This tool has many common RegEx expressions included with it, you might get lucky and it is there. If not, this is the tool I use to create my RegEx expressions.
If that tool doesn't help, look up some of the RegEx articles on CodeProject.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
try this: ^[a-zA-Z0-9'_.]*$
u can have the names like this also.
Eg 'Leary.
|
|
|
|
|
I am depolying a website on several different machines that we are testing with. We are trying to use anonymous authentication for the site. This works just fine for all the machines except for 1 running Windows XP. On that machine, it always pops up the Connect To dialog box for anyone that accesses the website.
I check the settings for the website and it is set to anonymous as the other machines are.
Also, if running locally, it will not bring up the Connect To dialog box if the web address is localhost or 127.0.0.1.
I know it has something to do with the machine security settings, but I am not able to figure out what.
Can anyone tell me what other things I need to look at in the machine in order to allow access without the Connect To dialog box showing up?
Thanks,
David
|
|
|
|
|
Hi all,
I have implemented Nested Master page concept in my web portal(which has multiple website in it).
Explanation:
Parent (Master Page) - webportal level master page.
child (Master page) - website level master page.
child uses the parent master page and content pages are produced from child master page.(That how it is nested).
Issues are:
1. .css file can only once reference, that is in parent master page.
when I tried to reference another stylesheet in my child master page, it didn't work.
Consequences: The style is going to bulk. because it is going to be global for web portal(for all the website inside the portal). Globally all page's received byte will be increased due to bulk .css file (decreases the performance).
2.
.js file can only once reference, that is in parent master page.
when I tried to reference another .js file in my child master page, it didn't work.
<b>Consequences:</b> The .js file is going to bulk. because it is going to be global for web portal(for all the website inside the portal). Globally all page's received byte will be increased due to bulk .js file (decreases the performance).
<b>3.</b> Globally there is only one form on parent master page. I want to have one form in the child master page for posting values to out side asp application. (that is from website level not from web portal level).
<b>Consequences:</b> Posting globally from parent master page is going make the parent master bulk with all the hidden fields to be posted from various websites in the portal. Globally all page's received byte will be increased due to bulk parent master page file (decreases the performance).
Please let me know. Is there a way to get arround the above issues.
I would appreciate your ant kind of help on this.
Thanks
Mohamed
|
|
|
|
|
1a. You can create themes, and put whatever css files you want in them. When a page uses a theme, links to the css files will be added to the header.
1b. Link tags can be added to the header using code.
2a. Your script tag is wrong, which may explain part of your problems. The script tag must have an end tag, even if it doesn't contain any code.
2b. You can include scripts anywhere in the page. Even if it's recommended to include scripts from the header, it can be done anywhere. It is frequently used anywhere in the code, for statistics and advertisments for example.
2c. Script tags can be added to the header using code.
3a. If you choose to have the form in the master page, your pages will be limited by that. There is no need to put the form in the master page.
3b. A page can have any number of forms, as long as they are not nested. Forms can even be added when needed using Javascript.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|