Want to stay on same Page after button click event - sharepoint-2010

I am working with small application in SharePoint. I have a custom application page on which i am loading .ascx Control under Page_Load() method. .ascx Control is a small form with text boxes and a button. Now when i click on button, the information successfully saved in the list in SharePoint, but it gives Runtime error:
Description: An application error occurred on the server. The current
custom error settings for this application prevent the details of the
application error from being viewed.
Details: To enable the details of this specific error message to be
viewable on the local server machine, please create a customErrors tag
within a "web.config" configuration file located in the root directory
of the current web application. This customErrors tag should then have
its "mode" attribute set to "RemoteOnly". To enable the details to be
viewable on remote machines, please set "mode" to "Off".
I have checked my web.config, and customError tag is there and mode is set to "Off".
what is problem ? I want to stay on same page after clicking button.

It is definitely staying on the same page as asp.net page always posts back to itself only and redirects only if you explicitly ask it to do so. There is either some error in your code or in you web.config file.
Further the error is in the block of postback code
i.e. Somewhere on your page there is some code like
if (isPostBack)
{
**//Some code with error**
}
as the error occurs only when you post back.
I would suggest you go step by step debugging and pin point the exact line of error.

By using Response.Redirect(Request.RawUrl); solves the above issue.

Related

How can I make Safari not use a cached version of a page?

In Safari 13.1 on MacOS 10.15.4, I have a page cache that seemingly can't be cleared.
I'm working on a site, served at localhost. When I load the page, I can see in my server logs that Safari requests the page, but it ignores the response and displays an outdated version of the page.
If I close the web inspector, the current version of the page loads, as expected. If I re-open the web inspector, the cached version loads.
I've tried:
Normal page refreshes
Going into the Network tab of the web inspector and toggling the "Use the resource cache when loading resources" button
Clicking the "reload" button in the inspector
Pressing "option + command + r" as that button's tool tip suggests, which is supposed to "reload page ignoring cache"
Develop -> Empty Caches
Quitting Safari and opening it again
Nothing helps.
In the Network tab of inspector, the request for the main page shows "(inspector override)" in the "Transfer Size" column, which seems to confirm that it's using some kind of cache.
How can I get Safari not to use a cache for this page when the web inspector is open?
Get Rid of the "Local Override"
The message "(inspector override)" in the "Transfer Size" column of the web inspector's Network tab indicates that a local override is set.
Also, I hadn't noticed that the page's icon was inverted in the Network tab, as that page says.
Without override:
With overide:
When a local override is set,
[Web inspector will] intercept the network activity and replace it with a local override, allowing for quick local testing without having to modify anything on a server.
When Web Inspector is open, network requests made by the inspected page that match the URL of a local override will instead use the the response content and MIME type, response status, and response headers from Web Inspector, rather than from the network or memory/disk cache.
https://webkit.org/web-inspector/local-overrides/
In my case, I did not know about this feature (which is actually pretty cool!) and apparently had created an override by accident.
To remove a local override, go into the Sources tab of the web inspector, find the "Local Overrides" section on the left, and either uncheck the local override for the page in question or right click it and select "Delete Local Override".

media folder suddenly empty

I'm trying to upload some images in my wordpress backend, but it fails every time. It could be permission issues because I have had trouble with that earlier in the project. But the weirdest thing is that I see on my server that the media folder is suddenly empty, while all the media in the wordpress backend is still there and the website is running fine. Anybody got an idea how this could have happened?
Try to edit one of the picture in the media on admin dashboard, there will be a text field titled 'File URL' on the right side.
Paste that into address bar and see if the browser loads it correctly. If yes then the problem is on the folder permission (or you might have opened the wrong directory), if not, you might wanna try to clear the browser cache or use another platform to open it.
Hope it helps!

First Time Trying to Edit a SharePoint File

This is my first time trying to edit a sharepoint file. It is used as a list of links in an iframe on a web site on another server. But this has nothing to do with the problem. I have been asked to modify the list of links and I just want to get to it and do it. But however one does this, it does not seem very intuative to me.
Let me tell you the steps I have taken and how things go wrong and maybe I can get some advice. The sharepoint file is on a server that I log into remotely. I run the "Sharepoint 2010 Central Administration". On the page that comes up, I click on "Manage web applications" under "Application Management".
From there, I see the page I want to edit. But when I click on the name of the item (which appears in red text) the area is hilighted but nothing happens. In the ribbon menu at the top of the page there is a drop down entitled "Site Actions" but there is no option there to "edit". Please advice.
I was given a username and password to "log in" because I was told I need that. The idea was that maybe I need a special admin account to see the missing menu options to edit a page. But at first I could not use it to log on to the server where the sharepoint system is. Then I found that I could try to use it to log onto the "Sharepoint 2010 Central Administration" program. But this did not work.
Then I tried to see if there was anything I could so from the desktop computer. I found "Microsoft SharePoint Workspace 2010"
I tried this and it looked promising"
http://i67.photobucket.com/albums/h292/Athono/SSO/SSO3_zpse15402e2.jpg
But then eventhough I could see the file name, I could not edit the file:
http://i67.photobucket.com/albums/h292/Athono/SSO/SSO4_zpsca7d0f71.jpg
I went back to the server and tried a few other things. I tried to switch my account in the Central Adminstration to this special account that someone suggested had more privledges but it did not work. The error said "Error: Access Denied". I tried putting the web page in the address bar and that just brought up the page without any way of editing it.
Please advise.
Central Administration is not meant for content editting. That is the core of SharePoint with all kind of configuration options.
You have to create a web application for content editting and create a site collection there. In that site collection you can edit the page, add webparts, etc. In your case you can try a Publishing Portal template for your site collection and add a content editor webpart. In that content editor webpart you can put HTML for your iframe.

default homepage not displaying

I have somewhat bizzarre situation... on my localhost when I debug the project all the pages are visible and first page (default page) is visible upon startup.
When I publish the project and move it to server all the pages are accessible and visible except the default (Home/Index).
My global.asax is ok, nothing is reporting any errors but when site is opened only the blank page is visible.
Could this be something with IIS? Since it's configured normally and we've event applied that hotfix for displaying pages without extensions (but it didn't work before that, tho).

Response.Redirect gives me 'Cannot display the page' error

This is a VB.Net 2005 Web Application Project.
I start out at my main menu (http://localhost/Default.aspx)
I click a link which does a callback to the server. In the code behind I have this:
HttpContext.Current.Response.Redirect(String.Format("{0}/{1}", ApplicationPath, PageName))
Which boils down to a string of this:
"//Administration/AdministrativeComparison.aspx"
The address bar of the browser remains at Default.aspx and I get an error.
Here's my message:
Internet Explorer cannot display the
webpage
Most likely causes: You are not connected to the Internet. The
website is encountering problems.
There might be a typing error in the
address.
What you can try:
Diagnose Connection Problems
Administration is a sub-project.
If I do this:
http://localhost//Administration/AdministrativeComparison.aspx
I do get to the page.
What can I do to get this to work?