|
What does 'doesn't work' mean ? You have a button with a name, which does not fire an event. What do you expect it to do ? The point of AJAX is to not do a postback, what do you WANT the button to do ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
"even a fool is considered wise, until he speaks'.
|
|
|
|
|
<div style="height: 300px; overflow: auto;">
<asp:DataGrid ....>
....
</asp:DataGrid>
</div>
The above used to work until I migrated to VS2008. Now the scrollbar is broken(it moves but the data won't)
Has something changed?
smcirish
Texas
|
|
|
|
|
Your best bet is to look at the generated HTML, figure out what changed, and work out if you can change it back.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I am looking at the generated HTML. The same HTML is producing different results.
-smc
smcirish
Texas
|
|
|
|
|
Well, that's just plain impossible.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Visual Studio didn't break your HTML. Have you tried other browsers? Are you using IE8? Have you tried it in compatibility mode?
only two letters away from being an asset
|
|
|
|
|
I am using IE 7.
-smc
smcirish
Texas
|
|
|
|
|
I tested your div tag, shortened to 100 px to force a vertical scroll bar, with a DataGrid loaded with data in VS2008. It worked just fine in IE8 and Mozilla 5. There has to be more to the story (code), to 'break' it, as the earlier commenter said.
<div style="height: 100px; overflow: auto;">
<asp:DataGrid runat="server" DataSourceID="LinqDataSource1"></asp:DataGrid>
</div>
Regards,
Gary
modified on Monday, July 13, 2009 9:31 PM
|
|
|
|
|
Have you added anything else to the page, try the page with just the div and datagrid. If that works try adding the other controls one at a time, it could be one of the controls above the div not terminated.
|
|
|
|
|
I have written the following code to display PDF is ASP.NET.
Dim strFilePath As String = Server.MapPath(".") & "\CollegeWriteUps\Vision.pdf"
Dim client As New WebClient
Dim buffer() As Byte = client.DownloadData(strFilePath)
Response.Clear()
If strFilePath.EndsWith(".pdf") Then
Response.ContentType = "application/pdf"
Response.AddHeader("content-length", buffer.Length.ToString())
Response.Flush()
Response.BinaryWrite(buffer)
End If
In Firefox, the web-page on which to show the PDF shows up blank, that too in new window/tab. Worst thing, the PDF shows up in Acrobat reader.
In IE, it simply shows up the dialog box asking for Open or Save the file.
How do I show the PDF in the same window/tab (in the browser)?
Thanks in advance.
|
|
|
|
|
Kumar Kush wrote: Worst thing, the PDF shows up in Acrobat reader.
Of course it does. The ONLY way a browser can show a PDF, is if Acrobat is installed, and then it runs in your browser.
Kumar Kush wrote: Dim client As New WebClient
Dim buffer() As Byte = client.DownloadData(strFilePath)
I have no idea what this is, but Response.WriteFile is the best way to write out a file, because you don't create a copy in memory.
Kumar Kush wrote: If strFilePath.EndsWith(".pdf") Then
Given that your path is hard coded, this seems superfluous.
Overall, what you're doing should work. I don't know why IE is not opening it with Acrobat, I would have expected it to, unless Acrobat is not installed for IE, for some strange reason. you could also try adding a Response.End at the end of all that, and see if it makes any difference, but I doubt it.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Place an iframe on your page and set the path of PDF to its src. If the client machine has Acrobat, it will open in the iframe.
|
|
|
|
|
Hi friends,
Im trying to show some images from the database into a Gridview.
I bounded the Gridview to the datasource:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1" Height="152px" Width="216px">
<Columns>
<asp:ImageField DataImageUrlField="pic">
</asp:ImageField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:studentConnectionString %>"
SelectCommand="SELECT [pic] FROM [pics]"></asp:SqlDataSource>
</form>
The problem is that i don't see the pics, bud only a image with a cross(X).
What is the reason for that?
Thanks.
|
|
|
|
|
|
Hi Abhijit,
Thanks for reseponse. I saw your article and i checked the path, im sure that the path is okay:
C:\Documents and Settings\HA\Mijn documenten\Visual Studio 2008\WebSites\student\\images\100_4567.jpg
Bud still the same problem
|
|
|
|
|
Priya Prk wrote: WebSites\student\\images\100_4567.jpg
This path is not ok, it has a double slash in it
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
You are right, that path was not valid. i removed one slash, bud it still did'nt worked.
To test is better i placed a image(image1.jpg) in C dir.
The path is : C:\image1.jpg
Bud it is still not working. i m confused
|
|
|
|
|
One thing - your path needs to be below the root of your website, you can't load images or other files from the file system as a whole, your web root is the root of your virtual file system. Other than that, I would look at the source to see what path is being passed in, to make sure it's valid in the browser.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi all,
Im having a problem where if i run a ajax based website on my developement machine using the Visual studio intergrated websever my ajax control works as expected all the ajax callback work.
If i publish the website to my live server(settings below) all the other controls work but ajax functionality gives a error message
"There was an error in callback" then what looks like a long string of random chars probably a hash.
Has anyone had anything similar? is there anything specifice i need to do to my IIS setup to get AJAX working propertly? Or would this be an error in my code, although if it where i dont see how it would work from Visual studio.
IIS Server Setup
On the ASP.NET tab of the site properties the site is set to, version 2.0.50727 and the website has its own application Pool.
Server is setup using Windows 2003 version 5.2.3790 SP2 Build 3790 and has .NET Framework 3.5 SP1
installed.
Thanks in advance
Phil
|
|
|
|
|
I think the server side function which ajax trying to execute is throwing an exception. Have you done any error handling functionality? Check your error logs.
|
|
|
|
|
Cheers ill check the logs tomorrow, when im in work again and update.
Phil
|
|
|
|
|
I think i am getting an exception but the code i wont to write into the event log isnt working.
Its a permission thing, i've created an event source in the registry but it still isnt writing too it. Im going to try to track down the users ASP is running under on my server and then all that user write permissions.
Thanks for the help, its always nice to go back to basics
|
|
|
|
|
Why on earth does every form I create run the Form_Load event when I click a button on the form? Is there something I am missing in the switch from Windows Forms to Web Forms? I feel like a right n00b on this but it is driving me mad to find that everytime it clears the form before trying to run the code.
A bit of further explanation...
I have a web-form application that dynamically sets itself up depending on who is looking at it. If an item in a list is selected and then a button clicked that should take you to another form, instead we are taken back through the form setup, which of course reloads the data back into the lists and therefore removes the selectedItem references.
So if anyone can help me stop my app doing this inane activity I will be grateful.
|
|
|
|
|
You need to understand that the way Windows executes program is completely different from the way you will see in your Web(ASP.Net) application.
The first thing one should write on the wall before starting any web application is that Web is stateless[^](or Google for a better answer).
Here [^]is a very good explanation regarding the order of events in ASP.Net page life.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|