|
lcharan wrote: there is no command argument in the gridview.its just a row.am using JS on click event
Ya there is no event for this since gridview is rendered as plain HTML table. What's the problem you are facing with JS onclick ?
|
|
|
|
|
function fnMoveItems(lstbxFrom,lstbxTo)
{
var varFromBox = document.all(lstbxFrom);
var varToBox = document.all(lstbxTo);
if ((varFromBox != null) && (varToBox != null))
{
if(varFromBox.length < 1)
{
alert('There are no items in the source ListBox');
return false;
}
if(varFromBox.options.selectedIndex == -1)
{
alert('Please select an Item to move');
return false;
}
while ( varFromBox.options.selectedIndex >= 0 )
{
var newOption = new Option();
newOption.text = varFromBox.options[varFromBox.options.selectedIndex].text;
newOption.value = varFromBox.options[varFromBox.options.selectedIndex].value;
varToBox.options[varToBox.length] = newOption;
varFromBox.remove(varFromBox.options.selectedIndex);
}
}
return false;
}
The above is my javascript code to move the values from one listbox to another. Once it move the values , the selected values are deleted from the sourceListbox(ie., left side listbox).
Actually my task is , it never deletes the selected value .
pls give the alternate code for it.
|
|
|
|
|
I have modified your code, you can use it.
function fnMoveItems(lstbxFrom,lstbxTo)
{
//var varFromBox = document.all(lstbxFrom);
//var varToBox = document.all(lstbxTo);
//You can access by list box id like
//var varFromBox = document.getElementById('lstbxFromID');
//var varToBox = document.getElementById('lstbxToID');
if ((varFromBox != null) && (varToBox != null))
{
if(varFromBox.length < 1)
{
alert('There are no items in the source ListBox');
return false;
}
if(varFromBox.options.selectedIndex == -1)
{
alert('Please select an Item to move');
return false;
}
var i;
for(i=varFromBox.options.length-1;i>=0;i--)
{
if(varFromBox.options[i].selected)
{
var optn = document.createElement("OPTION");
optn.text = varFromBox.options[i].text;
optn.value = varFromBox.options[i].value;
lstbxTo.options.add(optn);
varFromBox.remove(i);
}
}
}
return false;
}
Parwej Ahamad
g.parwez@gmail.com
|
|
|
|
|
Hello !1
actually i wanted to know that how can I display the contents of a text file in asp.net page . I am using vs.net 2003
Mrinal
|
|
|
|
|
Mri1a wrote: i wanted to know that how can I display the contents of a text file in asp.net page
1 - Map your text file using Server.MapPath()
2 - Use StreamReader class to start reading
3 - Assign value to a Label/Literal in ASPX page.
4 - Dispose StreamReader object
|
|
|
|
|
Dont repost.I did give u solution.
declare namespance "System.IO"
try this.It return content of .txt file
File.ReadAllText(Server.MapPath("content.txt"));
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
|
I'm using the in-build login feature for my web sites login with roles
Roles:Staff,Manager
I would like to know how to set the login so that when the staff logs in
he/she is directed to staff page instantly this also has to be the same for
the manager
|
|
|
|
|
duo!@# wrote: in-build login feature
Don't know what is that are you saying about built in login control ?
Any way for that if you have home page then in home page check the credetials for the logged in user according to that make server.transfer to respective page
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
What i meant by build in login control, instead of having a code based login which validates from the database. You get to pick up login controls from the toolbox and use the asp.net config to set roles and users.
To make it short an easier way of creating logins.
|
|
|
|
|
Please specify the environment requirements with any specific service packs.
|
|
|
|
|
I'm using a roles based website
This website uses a master page
The Roles:Staff,Manager
the roles are to make sure the staff cannot access the mangers page OK!
Now the Problem
i managed to get the master page looking nice, using images as div tags background.
For the roles based login to work it has to placed within a folder in the solution explorer.
I'm coming close to the problem.
Those neat div tags images go missing when i view the pages in the folder for staff and manager. It totally
|
|
|
|
|
Sounds like your master page is using relative paths, which then become relative to the subfolder your staff pages are in. Use absolute paths.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
i have a subfolder in my application with different file (doc, avi).
all files are accessible only when the user is authenticated in the application but i want to secure for direct access from url.
exemple : www.website.com/file/document.doc can't been donwloaded directly. the user must been authenticate to access to this file.
How i can do this?
ty
|
|
|
|
|
What kinda authentication are you using in your application?
If you are using integrated-window authentication then you can specify the specific permission or users to that folder.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
i use form authenthication in web.config:
User is stored in database.
How to do integrated-window authentication?
ty
|
|
|
|
|
If you wanna use integrated-window authentication, you have to create the user account on Active Directory Service of Window Server. then, you can set the permission on the folder.. and you need to disable the anonymous access for your website.. so, if someone is trying to access your website, it will show the login dialog to authenticate the user.
it is very easy to do in intranet site but if the website is on public server then you need to have dedicated hosting or something that can give the active directory service.... but it cost a lot of money...
maybe. HttpModule as N a v a n e e t h suggest might be good for you..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
ok but i try to do integrated-window authentication without Active Directory Service.
|
|
|
|
|
I don't think it can be done without using AD..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
jerome_data wrote: exemple : www.website.com/file/document.doc can't been donwloaded directly. the user must been authenticate to access to this file.
You can take the advantage of using HTTPModule. Write a HTTPModule and check all the request's. If any request comes for protected file types, check authentication, if not authenticated rewrite the URL to authentication page.
|
|
|
|
|
how do you do to protected file (other than aspx file of course) in subfolder?
|
|
|
|
|
jerome_data wrote: how do you do to protected file (other than aspx file of course) in subfolder?
Same way as I explained in the previous post. I reiterate
You have to write a HTTPModule and attach it with your website. HTTPModule is having set of events. You can use PrequestHandlerExecute event. This event fire's for all requests.
Assume you are getting a request like www.yourdomain.com/subfolder/file.doc which is a protected file. So first your HTTPModule will be invoked. In that check like
private void PreRequestHandlerExecute(Object source,EventArgs e)
{
HttpApplication CurrentApp = (HttpApplication)source;
if ( CurrentApp.Request.Url.AbsoluteUrl.EndsWith(".doc")
{
}
}
To get your HTTPModule working with other extensions than ASPX, map the extensions you want to process to aspnet_isapi.dll in IIS.
|
|
|
|
|
|
I have a Grid View. Here I have a column "Active". I attached this GridView to objectDataSource. In database this field has true or false value.(1 or 0). But in Grid View I want to show that if this field has value 1 in database the value for this column should show "Yes" but if the value of this field is 0 in data base the The GridView should show "No".
How can I do that.
seema
|
|
|
|
|
The most obvious way would be to write your data layer to return what you want to show. Otherwise, you need to write a custom column definition which takes the input and shows the text you want.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|