|
Dear All,
In my web applcation, I am creating a template column, which will hold an imge.
But as the template column is a class I am unable to take the path of the image.
Then I tried with HttpContext.Current.Server.MapPath, it also haven't work, then I had it as an embeded web resource.
I am unable to use the Page.ClientScript in order to use the function GetWebResourceUrl.
Then I passed the page to the class constructor and then I tried.
The above two scenarios dosen't work for me.
The code is below:
img.ImageUrl = instancePage.ClientScript.GetWebResourceUrl
(typeof(NewAdminTool), "MyApplicationName.Images." +
((DataRowView)container.DataItem)["FileExtID"].ToString() + ".jpg");
(instancePage is the instance of the page which is passed from the page where the grid is.)
and
img.ImageUrl = Path.Combine(HttpContext.Current.Server.MapPath("Images"), ((DataRowView)container.DataItem)["checked"].ToString() + ".gif");
Can any one help me to solve this?
It is very urgent.
Thanks a lot in advance
Best Regards,
M. J. Jaya Chitra
|
|
|
|
|
Did you try as below?
String strImageFile = "images\\";
strImageFile = ImageName + ".Jif";
if( File.Exists(Server.MapPath(strImageFile)) )
img.ImageUrl=strImageFile ;
Parwej Ahamad
R & D: REST services with WCF
|
|
|
|
|
hi friends,
I am trying to Import Excel Sheet Data to Gridview i used oledb connection to do this.
my Connection string goes like this
string strConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" E:\\test.xsl;Jet OLEDB:Max Buffer Size=256;Extended Properties=Excel 8.0;HDR=NO;IMEX=1";
When i open the connection i get the following error
Error code= 80004005 Error Description=Could not find installable ISAM
Kindly help me out
thanks,
praveen
|
|
|
|
|
hello fellas!
"Please i know this is a recurrent question. but i need some explanation.Please"
i'm a bit new and on probation period.Been giving a project to build a site registration system with Membership API.Please remember i'm new so please be easy.After reading atricles from the net and post from forums to forums. I made a change to the database with the aspnet_regsql.exe tool and stuff.All i need to do is to be able to store additional users information in another table create for that.
After reading this cool article from http://www.devx.com/codemag/Article/34492/0/page/1 i decided to go for this model since i have only to care about consist data in my additional table.
that model constist of inheriting classes like MembershipProvider, MembershipUser, etc and create custom functions for exemple creauser which will call the membership createuser then return the UserId to then use it to insert to my additional table.The fact is after reading those articles with differents approaches really confuses me more.Added the fact that i have done anything with security namespace.
So far it obvious to create my inheriting classes like.MySqlMembershipProvider, MyMembershipUser and MyMembership(for my methods create or GetUser).But from reading people creates classes like TheirConfiguration TheirProviderCollection.it confuses me.Can any one tell me which classes i really need for my schema ie one additional table?thanks
eager to learn
|
|
|
|
|
If you are new forget about all that stuff that you read on that article
highjo wrote: that model constist of inheriting classes like MembershipProvider
Forget about it and use as it is
highjo wrote: All i need to do is to be able to store additional users information in another table create for that.
For this, the easiest way is to store this info using profiles, if you dont want to use profiles, create your custom table and add a userName field to it, so that you can know to which user that record belongs to
But dont modify the aspnet_XXX tables
Alexei Rodriguez
|
|
|
|
|
Can't you use the built in profile provider for this?
Nirandas,
a developer from India.
http://www.nirandas.com
|
|
|
|
|
Say that a user is viewing a page on my site. They then type the address of another site in the browser's address bar. Finally, they use the back button to come back to the previous page on my site.my page is alive.but it should not happend. At this point, my requirement asks that the user has to login again.
Thanks...
|
|
|
|
|
I had seen this question before
There might be a way...
1.- Implement a webmethod or a page function that deletes the session (I think that it is not posible to end the authentication ticket in this type of call)
2.- Using javascript in the clientside, call this function when the user is leaving the page
I dont know the javascript event where you need to make the server call, but just take a look at the post new message page here at codeproject and see how it warns you about loosing the info if you leave the page (hitting the backbutton or writing a new url in the address bar) on that event instead of warning (or you could warn as well) call the server function or webmethod in step 1
Now, if you do it like this, if the user hits the back button (Once he is in another website), he will be able to see the page but when a postback is done, check to see if it is a new session (or look for a session field that was set when the user logged in), if your condition is not met, log the user out and redirectit to login page
I hope you work it out, but i really think you are going to far, i dont see any problem leaving your app as it is
Alexei Rodriguez
|
|
|
|
|
How do i create numeric paging in datalist control like 1|2|3|4|5.. Next
coolsatty
|
|
|
|
|
|
i have gridview , in which i hv column as Review comments, ....when data get display in tht.....i am not able to see full data
how i will increase size of row?
my aspx.cs code is as bellow
<C1WebGrid:C1BoundColumn DataField="Remarks"
HeaderText="Review Comments" SortExpression="Comments"><HeaderStyle
HorizontalAlign="Center" Wrap="True"></HeaderStyle>
<ItemStyle HorizontalAlign="Left" Wrap="true" Width="350px" ></ItemStyle>
|
|
|
|
|
Hi All
I am using checkboxlist control.I select 5 checkbox n store it in a single string.1,2,5,7,9 These are selected checkbox index n want these in a single string type variable Pls Help...............
Amit Gautam
|
|
|
|
|
English obviously isn't your first language and so it is hard to understand your question. Are you asking how to get the selected indexes of a checkboxlist isnt a comma-separated string?
if so this is how I usually accomplish (assume cbl is your checkboxlist)
List<string> selectedIndicies = new List<string>();
for(int i=0;i<cbl.items.count;i++)>
{
if(cbl.Items[i].Selected)
selectedIndicies.Add(i.ToString());
}
string result = String.Join(",",selectedIndicies.ToArray());
|
|
|
|
|
Hi all,
I'm looking to bolt on Forum / Social networking features to my site www.workoutbox.com (which is still under development). WorkoutBox is completley custom built from the ground up and runs on MS SQL 05.
The forum / social networking features I'm looking to add are very similar to these:
http://www.gyminee.com/forums
http://www.gyminee.com/groups/search/1[^]
Basically a nice clean Web 2.0 forum, with groups and profiles, thats easy to use and not over the top.
I now have two options, either have my freelancers build the forum, profiles and groups from the ground up, or use an open source forum engine like http://forum.yetanotherforum.net[^] and intergrate / reskin it into the site and plug in into my existing login / registration system.
I'n theory the open source route sounds quicker, but since I'll probably want to extend/customise whats there a fair bit anyway, that could give me more hassle than its worth. I'd really be greatfull for some outside advice on this one, as bad decisions here can turn your development project into a nightmare..
Thanks guys,
Simon
modified on Friday, September 19, 2008 6:57 AM
|
|
|
|
|
Simon, it is really a tough call.
As a .net programmer I would normally say build your own. However, forums have been done so many times that I am thinking it would be easier to use the open source forum. You might have to make a few minor design sacrifices, but it will save you time and money in development costs.
Really it is up to you though. Your site looks cool, I might just sign up when it is done.
I didn't get any requirements for the signature
|
|
|
|
|
I'd say it comes down to cost. If you want a fully customised forum then obviously you have to have it developed, which would probably be more expensive than taking an open source one. I suppose the other thing to consider is how open source is it? If you have the source code then its a very good starting point to extend from.
Always a difficult decision, but at the end of the day is it worth spoiling the look and feel of the site for the sake of a few more quid?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Hello
I try to use an Imagebutton instead of a LinkButton in my gridview to select and to delete a specific row but when using the asp.net application and press the image it will give this error:
"Invalid postback or callback argument. Event validation is enabled using <pages enableeventvalidation="true"> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
"
Please help
And tahnks in advance
Assaf
|
|
|
|
|
Add ====> EnableEventValidation="False"
In <%@ Page
Best Regards,
Chetan Patel
|
|
|
|
|
Thanks, now it didn't give me the error but as if i didn't do anything the select event is not fire
just the load event is fire
any help will be greatly appreciate
Thanks in Advance
Assaf
|
|
|
|
|
Hi All,
I hope all are doing good.Anyway
I need your help in calling webservice. I have one page with Address fields like address,city,State ans zipcode
Now i have to call a service and have to pass Address values to the service. Again before calling service i have to Validate these fields at server side if all things are right then call should made to service. After calling service I need to display dynamic text depending on the service result.
Now the question is which is better way to call the service
1. using Ajax and call the service from the function present at server
2.Is there any way to call service from JQuey but how to Validate my form fields (Custom Validation is at server no client side validation).
3. Can i use Page Methods for this but i need to update some fields on the page (Validation).
Any Ideas ?
Note: I can't make client side validation as i need to check State and zipcode value, User should provide correct zipcode for the state he has selected
modified on Friday, September 19, 2008 6:14 AM
|
|
|
|
|
Go with server side calling
You can use Ajax also if it is already present on the Page then only use it .
As u can't perform validation at client side there is no meaning in calling service using javascript
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... "
Check My Blog
|
|
|
|
|
Hi All,
Please give me a solution to close a firefox browser with javascript.
I have written the following code, but it is not working on firefox.
function closeWindow() {
window.open('','_parent','');
window.close();
}
Waiting for reply.
D'kng
|
|
|
|
|
javascript:void(window.close())
Put that in the PostBackUrl of the asp.net button
The answers posted by me are suggestions only and cannot be used in anyway against me.
|
|
|
|
|
Thanks... .netman
but it is still not working.
my code is:
<asp:button id="Button1" runat="server" text="Button" postbackurl="javascript:void(window.close())" xmlns:asp="#unknown">
D'kng
|
|
|
|
|